fix(m291): 守卫文档在 400 行内收(⑧ 并入 ⑦ 段,净增 0 行),make_dir_link 可见性收窄到 pub(super)(M291 r1)

This commit is contained in:
AskaEth committed 2026-11-13 00:48:38 +08:00
1 parent 375cc4f1fa
commit 7d16317411
2 files changed
+7 -13

No files matched your search

+4 -10
View File
@@ -30,16 +30,10 @@
//! `creation_flags(CREATE_NO_WINDOW)` ⇒ [`the_constructor_actually_passes_create_no_window`] 红; //! `creation_flags(CREATE_NO_WINDOW)` ⇒ [`the_constructor_actually_passes_create_no_window`] 红;
//! ④`game/java/discover.rs` 的 `quiet("reg")` 改回裸构造 ⇒ 必须红(见 P1-1)。 //! ④`game/java/discover.rs` 的 `quiet("reg")` 改回裸构造 ⇒ 必须红(见 P1-1)。
//! //!
//! M217(落在**此前不在射程内**的 crate 上):⑤`presenter/src/host/env.rs` 塞裸 //! M217(此前不在射程内的 crate):⑤`presenter/src/host/env.rs` 塞裸 `Command::new("tzutil")`
//! `Command::new("tzutil")` ⇒ 红并点名 `crates/presenter/src/host/env.rs:<行>`;⑥ //! ⇒ 红并点名 `crates/presenter/src/host/env.rs:<行>`;⑥`app-iced/src/platform/locale.rs` 的
//! `app-iced/src/platform/locale.rs` 的 `quiet(program)` 改回裸构造 ⇒ 红(用户报的那处 //! `quiet(program)` 改回裸构造 ⇒ 红(用户报的 `reg.exe`);⑦`export.rs` 三个 opener 留裸 +
//! `reg.exe`);⑦`export.rs` 三个 opener 留裸 + 清单写明理由 ⇒ **不**红。 //! 理由 ⇒ **不**红;⑧M291:`roots.rs::make_dir_link` 改回裸构造 ⇒ 红并点名(收并后仅 1 处)。
//!
//! 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)]`),
//! 所以现在的变异只可能剩一处。
//! //!
//! ## P1-1:守卫自己被变异验了两遍才对的 //! ## P1-1:守卫自己被变异验了两遍才对的
//! //!
+3 -3
View File
@@ -136,13 +136,13 @@ pub(in crate::host) fn key_of(path: &Path) -> String {
/// ///
/// 模块级而不是 `mod tests` 里,因为 [`super::tests_multiroot`] 的判据②也要造链接(M291):两处 /// 模块级而不是 `mod tests` 里,因为 [`super::tests_multiroot`] 的判据②也要造链接(M291):两处
/// 各写一份一字不差的 `cmd /c mklink /J` 只是把同一个坑埋两遍,`child_quiet_guard` 也是一次抓两处。 /// 各写一份一字不差的 `cmd /c mklink /J` 只是把同一个坑埋两遍,`child_quiet_guard` 也是一次抓两处。
/// 可见性只开到 `crate::host`——调用方就这两个用例模块。 /// 可见性只开到 `super`(`host::game`)——两个调用方都是它的直接子模块。
/// ///
/// 走 [`unlucky_core::platform::child::quiet`]:本仓库的 exe 是 GUI 程序(PE Subsystem = 2), /// 走 [`unlucky_core::platform::child::quiet`]:本仓库的 exe 是 GUI 程序(PE Subsystem = 2),
/// spawn `cmd.exe` 这种控制台程序时 Windows 会新开一块控制台(桌面上「黑框闪一下」)。 /// spawn `cmd.exe` 这种控制台程序时 Windows 会新开一块控制台(桌面上「黑框闪一下」)。
/// 语义不变:只看退出码(`.status()`),不读输出,失败一律 `false`。 /// 语义不变:只看退出码(`.status()`),不读输出,失败一律 `false`。
#[cfg(all(test, windows))] #[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") unlucky_core::platform::child::quiet("cmd")
.args(["/c", "mklink", "/J"]) .args(["/c", "mklink", "/J"])
.arg(link) .arg(link)
@@ -153,7 +153,7 @@ pub(in crate::host) fn make_dir_link(link: &Path, target: &Path) -> bool {
} }
#[cfg(all(test, not(windows)))] #[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() std::os::unix::fs::symlink(target, link).is_ok()
} }