MCPcopy Create free account
hub / github.com/bartman/git-wip / TEST

Function TEST

test/unit/test_git_helpers.cpp:14–23  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

12// ---------------------------------------------------------------------------
13
14TEST(OidToHex, FullLengthIs40) {
15 TestRepo repo;
16 repo.write_file("f", "hello");
17 git_oid oid = repo.commit("init");
18
19 std::string hex = oid_to_hex(&oid);
20 EXPECT_EQ(hex.size(), 40u);
21 // only hex digits
22 EXPECT_TRUE(hex.find_first_not_of("0123456789abcdef") == std::string::npos);
23}
24
25TEST(OidToHex, ShortLengthIs7) {
26 TestRepo repo;

Callers

nothing calls this directly

Calls 10

oid_to_hexFunction · 0.85
oid_to_short_hexFunction · 0.85
resolve_branch_namesFunction · 0.85
resolve_oidFunction · 0.85
ensure_reflog_dirFunction · 0.85
find_refsFunction · 0.85
write_fileMethod · 0.80
commitMethod · 0.80
repoMethod · 0.80
create_refMethod · 0.80

Tested by

no test coverage detected