diff --git a/crates/nightly/src/validate.rs b/crates/nightly/src/validate.rs index 99e832942b..008e9a6520 100644 --- a/crates/nightly/src/validate.rs +++ b/crates/nightly/src/validate.rs @@ -591,10 +591,14 @@ mod tests { Self { path } } - #[cfg(unix)] + #[cfg(any(unix, windows))] fn new_short(label: &str) -> Self { - // macOS limits Unix socket sun_path to 104 bytes; /tmp stays well under that limit. + // A Unix socket's sun_path holds 104 bytes on macOS and 108 on Windows. /tmp stays well under that limit. + #[cfg(unix)] let base = fs::canonicalize(Path::new("/tmp")).unwrap_or_else(|_| PathBuf::from("/tmp")); + // Not canonicalised: that adds the `\\?\` prefix to the path the test binds. + #[cfg(windows)] + let base = std::env::temp_dir(); let id = TEST_DIR_COUNTER.fetch_add(1, Ordering::Relaxed); let path = base.join(format!("cn-{label}-{}-{id}", std::process::id())); fs::create_dir_all(&path).expect("create short temp test dir"); @@ -867,7 +871,7 @@ mod tests { #[cfg(windows)] #[test] fn allows_windows_single_instance_socket_live_and_stale_and_rejects_elsewhere() { - let tmp = TempDir::new("wsock"); + let tmp = TempDir::new_short("w"); let home = tmp.path().join("h"); let profile = tmp.path().join("p"); let single_instance = profile.join("single-instance"); diff --git a/crates/ui-canvas/tests/it/canvas_controls/guides.rs b/crates/ui-canvas/tests/it/canvas_controls/guides.rs index d010888bfa..83f7315460 100644 --- a/crates/ui-canvas/tests/it/canvas_controls/guides.rs +++ b/crates/ui-canvas/tests/it/canvas_controls/guides.rs @@ -193,7 +193,6 @@ fn a_guide_dragged_under_the_centre_readout_names_its_side_and_its_distance_from let initial = if along == Axis::Y { 200.0 } else { 180.0 }; let guides: Shared> = Rc::new(RefCell::new(if pending { Vec::new() } else { vec![guide(1, along, initial)] })); let (mut fixture, words) = ruled_with(1.0, &guides, mode, bounds, twice); - fixture.fixture().hold(Modifiers::CTRL); let before: Vec = fixture.fixture().texts().iter().map(|run| run.text.clone()).collect(); let from = if pending { let room = fixture.canvas().rect; @@ -206,6 +205,8 @@ fn a_guide_dragged_under_the_centre_readout_names_its_side_and_its_distance_from let to = if along == Axis::Y { pos2(position, 300.0) } else { pos2(450.0, position) }; fixture.fixture().frame(vec![pointer::moved(from)]); fixture.fixture().frame(vec![pointer::press(from)]); + // Control turns snapping off. It goes down after the press: on macOS a Control press is a secondary click. + fixture.fixture().hold(Modifiers::CTRL); fixture.fixture().frame(vec![pointer::moved(from.lerp(to, 0.5))]); fixture.fixture().frame(vec![pointer::moved(to)]); let painted: Vec = diff --git a/crates/ui-widgets/tests/it/menu/steady_pass.rs b/crates/ui-widgets/tests/it/menu/steady_pass.rs index f76801a013..6789e251f5 100644 --- a/crates/ui-widgets/tests/it/menu/steady_pass.rs +++ b/crates/ui-widgets/tests/it/menu/steady_pass.rs @@ -1,6 +1,7 @@ //! An open menu in a pass with no measuring run, where each row registers with its level as the row runs: the letter //! each row announces, and how often a row's shortcut is measured. +use craft_host::target::Os; use craft_ui::contract::{Bind, Props as _, Show as _, ShowContainer as _}; use craft_ui::menu::{Menu, MenuItem}; use craft_ui::testing::{Fixture, last_pass_measure_asks, last_pass_measuring_runs, trial}; @@ -16,7 +17,8 @@ fn a_row_announces_the_letter_it_has_among_all_its_siblings() { MenuItem::new("&Select All").show(ui); }); }); - fixture.settle(); + // A Mac menu has no access letters. + fixture.os(Os::Linux).settle(); for frame in 0..3 { let key = |fixture: &Fixture, label: &str| { let row = fixture.by_label(label).expect("the menu shows the row");