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

Function test_modified_time_exists

atomic-core/src/output/filesystem/tests.rs:273–283  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

271
272#[test]
273fn test_modified_time_exists() {
274 let (dir, fs) = temp_fs();
275 std::fs::write(dir.path().join("file.txt"), "content").unwrap();
276
277 let mtime = fs.modified_time("file.txt").unwrap();
278 let now = SystemTime::now();
279
280 // Modified time should be very recent (within last 10 seconds)
281 let elapsed = now.duration_since(mtime).unwrap();
282 assert!(elapsed.as_secs() < 10);
283}
284
285#[test]
286fn test_modified_time_not_found() {

Callers

nothing calls this directly

Calls 5

temp_fsFunction · 0.85
writeFunction · 0.85
unwrapMethod · 0.45
pathMethod · 0.45
modified_timeMethod · 0.45

Tested by

no test coverage detected