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

Function test_add_run_non_recursive

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

Source from the content-addressed store, hash-verified

1111 #[test]
1112 #[file_serial]
1113 fn test_add_run_non_recursive() {
1114 let _guard = DirGuard::new();
1115
1116 let temp_dir = tempfile::tempdir().unwrap();
1117 let repo_path = temp_dir.path();
1118
1119 // Initialize repository
1120 {
1121 let _repo = Repository::init(repo_path).unwrap();
1122 }
1123
1124 // Create directory with files
1125 let src_dir = repo_path.join("src");
1126 std::fs::create_dir(&src_dir).unwrap();
1127 std::fs::write(src_dir.join("main.rs"), "fn main() {}").unwrap();
1128
1129 std::env::set_current_dir(repo_path).unwrap();
1130
1131 let add = Add::new().with_files(vec!["src"]).with_recursive(false);
1132 let result = add.run();
1133
1134 assert!(
1135 result.is_ok(),
1136 "Add non-recursive failed: {:?}",
1137 result.err()
1138 );
1139 }
1140
1141 #[test]
1142 #[file_serial]

Callers

nothing calls this directly

Calls 7

initFunction · 0.50
writeFunction · 0.50
unwrapMethod · 0.45
pathMethod · 0.45
with_recursiveMethod · 0.45
with_filesMethod · 0.45
runMethod · 0.45

Tested by

no test coverage detected