MCPcopy Create free account
hub / github.com/clice-io/clice / TEST_CASE

Function TEST_CASE

tests/unit/command/cdb_diff_tests.cpp:33–55  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

31TEST_SUITE(ReloadDiff) {
32
33TEST_CASE(AddedEntry) {
34 TempDir tmp;
35 CompilationDatabase cdb;
36 auto cdb_path = tmp.path("compile_commands.json");
37
38 write_json(tmp,
39 {
40 {tmp.root.str(), "a.cpp", {}}
41 });
42 cdb.load(cdb_path);
43
44 write_json(tmp,
45 {
46 {tmp.root.str(), "a.cpp", {}},
47 {tmp.root.str(), "b.cpp", {}}
48 });
49 auto diff = cdb.reload_and_diff(cdb_path);
50
51 ASSERT_EQ(diff->added.size(), 1U);
52 EXPECT_EQ(diff->added[0], id_of(cdb, tmp, "b.cpp"));
53 EXPECT_TRUE(diff->removed.empty());
54 EXPECT_TRUE(diff->changed.empty());
55};
56
57TEST_CASE(RemovedEntry) {
58 TempDir tmp;

Callers

nothing calls this directly

Calls 15

write_jsonFunction · 0.85
id_ofFunction · 0.85
containsFunction · 0.85
joinFunction · 0.85
print_argvFunction · 0.85
remove_allFunction · 0.85
reload_and_diffMethod · 0.80
has_entryMethod · 0.80
touchMethod · 0.80
to_argvMethod · 0.80
pathMethod · 0.45
loadMethod · 0.45

Tested by

no test coverage detected