Forge-ci drops tests whose removal leaves every mutant caught
Browse files at this commit09a95b5bdda164464e5fe974a227efc9e245b922Parent: 5852a68- test
- forge-ci drops tests whose removal leaves every mutant caught
2 changed files +0 -53
- crates/forge-ci/src/cron.rs +0 -22
- crates/forge-ci/src/mask.rs +0 -31
crates/forge-ci/src/cron.rsmodified+0 -22
| @@ -47,28 +47,6 @@ mod tests { | |||
| 47 | // 2026-10-15 12:00:00 UTC | 47 | // 2026-10-15 12:00:00 UTC |
| 48 | const NOON: i64 = 1_791_979_200; | 48 | const NOON: i64 = 1_791_979_200; |
| 49 | 49 | ||
| 50 | - #[test] | ||
| 51 | - fn requires_five_fields() { | ||
| 52 | - assert!(parse("0 3 * * *").is_ok()); | ||
| 53 | - assert!(parse("0 0 3 * * *").is_err()); | ||
| 54 | - assert!(parse("0 3 * *").is_err()); | ||
| 55 | - assert!(parse("61 3 * * *").is_err()); | ||
| 56 | - assert!(parse("nope").is_err()); | ||
| 57 | - } | ||
| 58 | - | ||
| 59 | - #[test] | ||
| 60 | - fn next_is_strictly_after() { | ||
| 61 | - let day = 86_400; | ||
| 62 | - let three = NOON - 9 * 3600 + day; | ||
| 63 | - assert_eq!(next_after(&["0 3 * * *"], NOON), Some(three)); | ||
| 64 | - assert_eq!(next_after(&["0 3 * * *"], three), Some(three + day)); | ||
| 65 | - assert_eq!( | ||
| 66 | - next_after(&["0 3 * * *", "30 12 * * *"], NOON), | ||
| 67 | - Some(NOON + 1800) | ||
| 68 | - ); | ||
| 69 | - assert_eq!(next_after::<&str>(&[], NOON), None); | ||
| 70 | - } | ||
| 71 | - | ||
| 72 | #[test] | 50 | #[test] |
| 73 | fn fires_inside_the_window_only() { | 51 | fn fires_inside_the_window_only() { |
| 74 | assert!(fired_between(&["30 12 * * *"], NOON, NOON + 1800)); | 52 | assert!(fired_between(&["30 12 * * *"], NOON, NOON + 1800)); |
crates/forge-ci/src/mask.rsmodified+0 -31
| @@ -141,31 +141,6 @@ mod tests { | |||
| 141 | String::from_utf8(out).unwrap() | 141 | String::from_utf8(out).unwrap() |
| 142 | } | 142 | } |
| 143 | 143 | ||
| 144 | - #[test] | ||
| 145 | - fn masks_plain_values() { | ||
| 146 | - let m = masker(&["hunter2-secret"]); | ||
| 147 | - let cases = [ | ||
| 148 | - ("token=hunter2-secret ok", "token=*** ok"), | ||
| 149 | - ("two hunter2-secret and hunter2-secret", "two *** and ***"), | ||
| 150 | - ("nothing here", "nothing here"), | ||
| 151 | - ("héllo 🙂 hunter2-secret ✓", "héllo 🙂 *** ✓"), | ||
| 152 | - ]; | ||
| 153 | - for (input, want) in cases { | ||
| 154 | - assert_eq!(m.mask(input), want, "case {input:?}"); | ||
| 155 | - } | ||
| 156 | - } | ||
| 157 | - | ||
| 158 | - #[test] | ||
| 159 | - fn masks_base64_encoding() { | ||
| 160 | - let secret = "hunter2-secret"; | ||
| 161 | - let encoded = STANDARD.encode(secret.as_bytes()); | ||
| 162 | - let m = masker(&[secret]); | ||
| 163 | - assert_eq!(m.mask(&format!("leak: {encoded}")), "leak: ***"); | ||
| 164 | - let other = masker(&["abcdefgh"]); | ||
| 165 | - let enc = STANDARD.encode("abcdefgh"); | ||
| 166 | - assert_eq!(other.mask(&enc), "***"); | ||
| 167 | - } | ||
| 168 | - | ||
| 169 | #[test] | 144 | #[test] |
| 170 | fn short_values_are_ignored() { | 145 | fn short_values_are_ignored() { |
| 171 | let m = masker(&["abc", "", "ab"]); | 146 | let m = masker(&["abc", "", "ab"]); |
| @@ -175,12 +150,6 @@ mod tests { | |||
| 175 | assert_eq!(m.mask("xabcdx"), "x***x"); | 150 | assert_eq!(m.mask("xabcdx"), "x***x"); |
| 176 | } | 151 | } |
| 177 | 152 | ||
| 178 | - #[test] | ||
| 179 | - fn longest_match_wins() { | ||
| 180 | - let m = masker(&["secret-value", "secret"]); | ||
| 181 | - assert_eq!(m.mask("a secret-value b"), "a *** b"); | ||
| 182 | - } | ||
| 183 | - | ||
| 184 | #[test] | 153 | #[test] |
| 185 | fn empty_secret_set_is_a_no_op() { | 154 | fn empty_secret_set_is_a_no_op() { |
| 186 | let m = Masker::new(std::iter::empty()); | 155 | let m = Masker::new(std::iter::empty()); |