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:295–305  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

293
294#[test]
295fn test_modified_time_exists() {
296 let (dir, fs) = temp_fs();
297 std::fs::write(dir.path().join("file.txt"), "content").unwrap();
298
299 let mtime = fs.modified_time("file.txt").unwrap();
300 let now = SystemTime::now();
301
302 // Modified time should be very recent (within last 10 seconds)
303 let elapsed = now.duration_since(mtime).unwrap();
304 assert!(elapsed.as_secs() < 10);
305}
306
307#[test]
308fn test_modified_time_not_found() {

Callers

nothing calls this directly

Calls 5

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

Tested by

no test coverage detected