Mutation pins for run recall: split rule and directory

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
Weksa 2026-11-14 00:34:13 +00:00
commit 9e68d2d978
3 changed files with 32 additions and 0 deletions

View file

@ -3112,6 +3112,9 @@ fn discard_inventory(dir: &Path) {
}
}
#[cfg(test)]
mod mutants;
#[cfg(test)]
mod tests {
use super::*;

View file

@ -0,0 +1,21 @@
//! Pins for private functions of `run.rs` that the doors reach only through a
//! whole run.
use super::*;
/// A line is probed only when it has at least four words, and then it is
/// split in two near its byte middle, the pieces trimmed.
#[test]
fn a_recall_line_splits_from_four_words_and_not_before() {
assert_eq!(recall_split("one two three"), None);
assert_eq!(recall_split(""), None);
assert_eq!(
recall_split("one two three four"),
Some(("one two".to_string(), "three four".to_string()))
);
// No spaces: each ideograph is a word, the split falls at the middle.
assert_eq!(
recall_split("天地不仁以万物为刍狗"),
Some(("天地不仁以".to_string(), "万物为刍狗".to_string()))
);
}

View file

@ -105,3 +105,11 @@ fn a_panel_language_no_item_carries_is_refused_at_open() {
assert!(matches!(create(panel), Err(weksa::run::RunError::Panel)), "{panel:?}");
}
}
/// A run keeps its recall probes in `recall` under its own root.
#[test]
fn a_run_keeps_its_recall_under_its_root() {
let dir = tempfile::tempdir().unwrap();
let run = common::run_over(dir.path());
assert_eq!(run.recall_dir(), dir.path().join("run").join("recall"));
}