diff --git a/komorebi-recorder/src/lock.rs b/komorebi-recorder/src/lock.rs index 9b17b47c..6b6e0370 100644 --- a/komorebi-recorder/src/lock.rs +++ b/komorebi-recorder/src/lock.rs @@ -248,7 +248,9 @@ mod tests { let dir = temp("pidfile"); let _lock = RecorderLock::acquire(&dir).expect("acquire"); - // Windows would refuse to read a file that is locked, so the pid cannot live in it + // Windows would refuse to read a file that is locked, so the pid cannot live in it (and + // this test cannot read it there either) + #[cfg(unix)] assert_eq!( std::fs::read_to_string(dir.join(LOCK_FILE)).expect("lock file"), "" @@ -261,6 +263,8 @@ mod tests { ); } + // an older build only ever ran on a Mac, and Windows cannot read a pid out of a locked file + #[cfg(unix)] #[test] fn a_pid_written_into_the_lock_file_by_an_older_build_is_still_read() { let dir = temp("legacy"); diff --git a/komorebi-recorder/src/session.rs b/komorebi-recorder/src/session.rs index 643dbf5f..7ef56acd 100644 --- a/komorebi-recorder/src/session.rs +++ b/komorebi-recorder/src/session.rs @@ -688,7 +688,15 @@ mod tests { assert!(text.contains("QueryPerformanceCounter")); assert!(!text.contains("unified log"), "{text}"); - let mac = readme(Path::new("/tmp/s"), &self::tests::manifest()); + // a Mac's, whichever host runs this test + let mut mac_manifest = self::tests::manifest(); + mac_manifest.host = Some(Host { + os: "macos".to_string(), + arch: "aarch64".to_string(), + os_version: Some("26.0".to_string()), + clock: crate::platform::ClockKind::Mach, + }); + let mac = readme(Path::new("/tmp/s"), &mac_manifest); assert!(mac.contains("macOS unified log")); } @@ -785,7 +793,7 @@ mod tests { fn the_readme_embeds_the_session_path_and_every_query() { let text = readme(Path::new("/tmp/a b/session"), &manifest()); assert!( - text.contains("'/tmp/a b/session'"), + text.contains(&shell_quote("/tmp/a b/session")), "paths with spaces are quoted" ); for command in [