MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / test_diff_run_with_added_file

Function test_diff_run_with_added_file

atomic-cli/src/commands/diff/tests.rs:1091–1111  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1089 #[test]
1090 #[serial]
1091 fn test_diff_run_with_added_file() {
1092 let _guard = DirGuard::new();
1093
1094 let temp_dir = tempfile::tempdir().unwrap();
1095 let repo_path = temp_dir.path();
1096
1097 // Initialize repository, create and add a file
1098 {
1099 let repo = Repository::init(repo_path).unwrap();
1100 std::fs::write(repo_path.join("new_file.txt"), "New content").unwrap();
1101 repo.add("new_file.txt", Default::default()).unwrap();
1102 }
1103
1104 std::env::set_current_dir(repo_path).unwrap();
1105
1106 let diff = Diff::new();
1107 let result = diff.run();
1108
1109 // Should succeed and show the added file
1110 assert!(result.is_ok());
1111 }
1112
1113 #[test]
1114 #[serial]

Callers

nothing calls this directly

Calls 5

writeFunction · 0.85
unwrapMethod · 0.45
pathMethod · 0.45
addMethod · 0.45
runMethod · 0.45

Tested by

no test coverage detected