Skip to main content

max / makeover

Add tests to kill surviving mutants in shared crates Mutation-coverage pass against docengine, tagtree, and theme-common. Each test pins a specific decision boundary that prior tests left unconstrained — Display impls, is_empty distinguishers, http vs https arms, edit_distance arithmetic, dev_themes_dir Some/None split, etc. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Author: Max J. <87768334+MaxJMath@users.noreply.github.com> · 2026-05-15 17:13 UTC
Commit: 8e22d89dc4224bb611dc85a743940caedd95bb04
Parent: 58bdfbf
1 file changed, +29 insertions, -0 deletions
M src/lib.rs +29
@@ -481,6 +481,35 @@ primary = "#ff0000"
481 481 }
482 482
483 483 #[test]
484 + fn dev_themes_dir_returns_some_when_structure_exists() {
485 + // Construct a fake tree: <tmp>/leaf where <tmp>/MNW/shared/themes exists.
486 + // Walking up 1 level from `leaf` should locate the themes dir.
487 + // Catches `dev_themes_dir -> Option<PathBuf> with None` (always-None mutant).
488 + let root = tempfile::tempdir().unwrap();
489 + let leaf = root.path().join("leaf");
490 + std::fs::create_dir_all(&leaf).unwrap();
491 + let themes = root.path().join("MNW").join("shared").join("themes");
492 + std::fs::create_dir_all(&themes).unwrap();
493 +
494 + let result = dev_themes_dir(&leaf, 1);
495 + // Compare canonical forms — tempfile may return paths with /private prefix on macOS.
496 + let result_canon = result.expect("expected Some").canonicalize().unwrap();
497 + let themes_canon = themes.canonicalize().unwrap();
498 + assert_eq!(result_canon, themes_canon);
499 + }
500 +
501 + #[test]
502 + fn dev_themes_dir_returns_none_when_structure_missing() {
503 + // No MNW/shared/themes under the temp root → None.
504 + let root = tempfile::tempdir().unwrap();
505 + let leaf = root.path().join("leaf");
506 + std::fs::create_dir_all(&leaf).unwrap();
507 + // No themes dir created.
508 + let result = dev_themes_dir(&leaf, 1);
509 + assert!(result.is_none());
510 + }
511 +
512 + #[test]
484 513 fn import_theme_valid() {
485 514 let src_dir = tempfile::tempdir().unwrap();
486 515 let custom_dir = tempfile::tempdir().unwrap();