From 7d163174119bb9bb11730503dc0456747e322db8 Mon Sep 17 00:00:00 2001 From: AskaEth Date: Fri, 13 Nov 2026 00:48:38 +0800 Subject: [PATCH] =?UTF-8?q?fix(m291):=20=E5=AE=88=E5=8D=AB=E6=96=87?= =?UTF-8?q?=E6=A1=A3=E5=9C=A8=20400=20=E8=A1=8C=E5=86=85=E6=94=B6=EF=BC=88?= =?UTF-8?q?=E2=91=A7=20=E5=B9=B6=E5=85=A5=20=E2=91=A6=20=E6=AE=B5=EF=BC=8C?= =?UTF-8?q?=E5=87=80=E5=A2=9E=200=20=E8=A1=8C=EF=BC=89=EF=BC=8Cmake=5Fdir?= =?UTF-8?q?=5Flink=20=E5=8F=AF=E8=A7=81=E6=80=A7=E6=94=B6=E7=AA=84?= =?UTF-8?q?=E5=88=B0=20pub(super)=EF=BC=88M291=20r1=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- crates/core/tests/child_quiet_guard.rs | 14 ++++---------- crates/presenter/src/host/game/roots.rs | 6 +++--- 2 files changed, 7 insertions(+), 13 deletions(-) diff --git a/crates/core/tests/child_quiet_guard.rs b/crates/core/tests/child_quiet_guard.rs index 89ca7f7..1031c2c 100644 --- a/crates/core/tests/child_quiet_guard.rs +++ b/crates/core/tests/child_quiet_guard.rs @@ -30,16 +30,10 @@ //! `creation_flags(CREATE_NO_WINDOW)` ⇒ [`the_constructor_actually_passes_create_no_window`] 红; //! ④`game/java/discover.rs` 的 `quiet("reg")` 改回裸构造 ⇒ 必须红(见 P1-1)。 //! -//! M217(落在**此前不在射程内**的 crate 上):⑤`presenter/src/host/env.rs` 塞裸 -//! `Command::new("tzutil")` ⇒ 红并点名 `crates/presenter/src/host/env.rs:<行>`;⑥ -//! `app-iced/src/platform/locale.rs` 的 `quiet(program)` 改回裸构造 ⇒ 红(用户报的那处 -//! `reg.exe`);⑦`export.rs` 三个 opener 留裸 + 清单写明理由 ⇒ **不**红。 -//! -//! M291(`presenter` 的 junction 夹具):⑧`host/game/roots.rs` 的 `make_dir_link` 改回裸 -//! `Command::new("cmd")` ⇒ 红并点名 `crates/presenter/src/host/game/roots.rs:146`。这一条同时钉 -//! 一处**收并**:改之前本守卫一次抓到两处(`mklink /J` 的产品副本 `roots.rs:193` 与测试副本 -//! `tests_multiroot.rs:83`),M291 把两份收成一个共享夹具(`roots::make_dir_link`,`#[cfg(test)]`), -//! 所以现在的变异只可能剩一处。 +//! M217(此前不在射程内的 crate):⑤`presenter/src/host/env.rs` 塞裸 `Command::new("tzutil")` +//! ⇒ 红并点名 `crates/presenter/src/host/env.rs:<行>`;⑥`app-iced/src/platform/locale.rs` 的 +//! `quiet(program)` 改回裸构造 ⇒ 红(用户报的 `reg.exe`);⑦`export.rs` 三个 opener 留裸 + +//! 理由 ⇒ **不**红;⑧M291:`roots.rs::make_dir_link` 改回裸构造 ⇒ 红并点名(收并后仅 1 处)。 //! //! ## P1-1:守卫自己被变异验了两遍才对的 //! diff --git a/crates/presenter/src/host/game/roots.rs b/crates/presenter/src/host/game/roots.rs index 0a0b6d3..3ead039 100644 --- a/crates/presenter/src/host/game/roots.rs +++ b/crates/presenter/src/host/game/roots.rs @@ -136,13 +136,13 @@ pub(in crate::host) fn key_of(path: &Path) -> String { /// /// 模块级而不是 `mod tests` 里,因为 [`super::tests_multiroot`] 的判据②也要造链接(M291):两处 /// 各写一份一字不差的 `cmd /c mklink /J` 只是把同一个坑埋两遍,`child_quiet_guard` 也是一次抓两处。 -/// 可见性只开到 `crate::host`——调用方就这两个用例模块。 +/// 可见性只开到 `super`(`host::game`)——两个调用方都是它的直接子模块。 /// /// 走 [`unlucky_core::platform::child::quiet`]:本仓库的 exe 是 GUI 程序(PE Subsystem = 2), /// spawn `cmd.exe` 这种控制台程序时 Windows 会新开一块控制台(桌面上「黑框闪一下」)。 /// 语义不变:只看退出码(`.status()`),不读输出,失败一律 `false`。 #[cfg(all(test, windows))] -pub(in crate::host) fn make_dir_link(link: &Path, target: &Path) -> bool { +pub(super) fn make_dir_link(link: &Path, target: &Path) -> bool { unlucky_core::platform::child::quiet("cmd") .args(["/c", "mklink", "/J"]) .arg(link) @@ -153,7 +153,7 @@ pub(in crate::host) fn make_dir_link(link: &Path, target: &Path) -> bool { } #[cfg(all(test, not(windows)))] -pub(in crate::host) fn make_dir_link(link: &Path, target: &Path) -> bool { +pub(super) fn make_dir_link(link: &Path, target: &Path) -> bool { std::os::unix::fs::symlink(target, link).is_ok() }