MCPcopy Create free account
hub / github.com/LadybugDB/ladybug / TEST

Function TEST

test/api/file_search_path_test.cpp:19–27  ·  view source on GitHub ↗

Verifies that creating a Connection to an on-disk database automatically adds the database directory to the VFS file search path.

Source from the content-addressed store, hash-verified

17// Verifies that creating a Connection to an on-disk database automatically adds
18// the database directory to the VFS file search path.
19TEST(FileSearchPathTest, DBInitAddsDBDirToSearchPath) {
20 auto dbPath = TestHelper::getTempDBPathStr("FileSearchPath.DBInit");
21 auto database = std::make_unique<Database>(dbPath, SystemConfig());
22 auto conn = std::make_unique<Connection>(database.get());
23
24 auto expectedDir = fs::path(dbPath).parent_path().lexically_normal().string();
25 const auto& searchPath = conn->getClientContext()->getClientConfigUnsafe()->fileSearchPath;
26 EXPECT_EQ(searchPath, expectedDir);
27}
28
29// Verifies that an in-memory database does not add any entry to the file search path.
30TEST(FileSearchPathTest, InMemoryDBHasEmptySearchPath) {

Callers

nothing calls this directly

Calls 10

SystemConfigClass · 0.85
getMethod · 0.45
getClientContextMethod · 0.45
queryMethod · 0.45
isSuccessMethod · 0.45
toStringMethod · 0.45
findMethod · 0.45
sizeMethod · 0.45
emptyMethod · 0.45

Tested by

no test coverage detected