MCPcopy Create free account
hub / github.com/MrBeanCpp/MIT / test_commit

Function test_commit

src/commands/commit.rs:54–69  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

52
53 #[test]
54 fn test_commit() {
55 test_util::setup_test_with_clean_mit();
56 let test_file = "a.txt";
57 let head_one = head::current_head_commit();
58 assert!(head_one.is_empty());
59
60 test_util::ensure_test_file(&Path::new(test_file), "test content".into());
61 cmd::add(vec![], true, false);
62 cmd::commit("test commit 1".to_string(), true);
63 let head_two = head::current_head_commit();
64 assert!(head_two.len() > 0);
65
66 let commit = models::commit::Commit::load(&head_two);
67 assert!(commit.get_parent_hash().len() == 0);
68 assert!(commit.get_message() == "test commit 1");
69 }
70}

Callers

nothing calls this directly

Calls 5

current_head_commitFunction · 0.85
ensure_test_fileFunction · 0.85
addFunction · 0.85
commitFunction · 0.85

Tested by

no test coverage detected