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

Function test_add_run_single_file

atomic-cli/src/commands/add.rs:806–826  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

804 #[test]
805 #[serial]
806 fn test_add_run_single_file() {
807 let _guard = DirGuard::new();
808
809 let temp_dir = tempfile::tempdir().unwrap();
810 let repo_path = temp_dir.path();
811
812 // Initialize repository
813 {
814 let _repo = Repository::init(repo_path).unwrap();
815 }
816
817 // Create a file to add
818 std::fs::write(repo_path.join("test.txt"), "Hello, World!").unwrap();
819
820 std::env::set_current_dir(repo_path).unwrap();
821
822 let add = Add::new().with_files(vec!["test.txt"]);
823 let result = add.run();
824
825 assert!(result.is_ok(), "Add failed: {:?}", result.err());
826 }
827
828 #[test]
829 #[serial]

Callers

nothing calls this directly

Calls 5

writeFunction · 0.85
unwrapMethod · 0.45
pathMethod · 0.45
with_filesMethod · 0.45
runMethod · 0.45

Tested by

no test coverage detected