()
| 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 | } |
nothing calls this directly
no test coverage detected