chore: prune low-value tests per CLAUDE_SPEC.md §10 + WORKFLOW §8
The Quat-flagged "≥3 tests per feature" inflation produced 43 tests
that don't earn their existence — default-value, serde-derive
round-trips on plain structs, single-field clamp tests, near-
duplicates, and trivial constant-equals-itself tests. None pin a
behaviour contract or a regression on a real bug.
Removed across `solitaire_data` and `solitaire_core`:
settings.rs −22 default-value, round-trip, legacy-format,
and per-field sanitized clamp tests. Adjust
and load-error tests retained — those exercise
real method logic.
progress.rs −1 generic round-trip on plain struct.
challenge.rs −1 challenge_count() returns CHALLENGE_SEEDS.len()
literally — testing it asserts the implementation
against itself.
game_state.rs −3 undo_count starts at 0, GameMode default is
Classic, time_attack score starts at 0 — all
default-value tests on freshly-constructed state.
card.rs −5 rank_value_ace + rank_value_king subsumed by
rank_values_are_sequential; suit_red + suit_black
consolidated into one complementarity test;
card_face_up_field_reflects_construction was
testing the struct literal.
Workspace: 1208 → 1165 passing tests (−43). clippy --workspace
--all-targets clean.
Future work: brief sub-agents for tests that pin a behaviour
contract or regression on a real bug, not a count of N. See
`feedback_test_discipline.md` in auto-memory.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -77,16 +77,6 @@ pub struct Card {
|
||||
mod tests {
|
||||
use super::*;
|
||||
|
||||
#[test]
|
||||
fn rank_value_ace_is_one() {
|
||||
assert_eq!(Rank::Ace.value(), 1);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn rank_value_king_is_thirteen() {
|
||||
assert_eq!(Rank::King.value(), 13);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn rank_values_are_sequential() {
|
||||
let ranks = [
|
||||
@@ -100,26 +90,11 @@ mod tests {
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn suit_red_is_diamonds_and_hearts() {
|
||||
assert!(Suit::Diamonds.is_red());
|
||||
assert!(Suit::Hearts.is_red());
|
||||
assert!(!Suit::Clubs.is_red());
|
||||
assert!(!Suit::Spades.is_red());
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn suit_black_is_clubs_and_spades() {
|
||||
assert!(Suit::Clubs.is_black());
|
||||
assert!(Suit::Spades.is_black());
|
||||
assert!(!Suit::Diamonds.is_black());
|
||||
assert!(!Suit::Hearts.is_black());
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn card_face_up_field_reflects_construction() {
|
||||
let card = Card { id: 0, suit: Suit::Hearts, rank: Rank::Ace, face_up: false };
|
||||
assert!(!card.face_up);
|
||||
let card2 = Card { id: 1, suit: Suit::Spades, rank: Rank::King, face_up: true };
|
||||
assert!(card2.face_up);
|
||||
fn suit_red_and_black_are_complementary() {
|
||||
for suit in [Suit::Clubs, Suit::Diamonds, Suit::Hearts, Suit::Spades] {
|
||||
assert_ne!(suit.is_red(), suit.is_black(), "{suit:?} must be exactly one of red/black");
|
||||
}
|
||||
assert!(Suit::Diamonds.is_red() && Suit::Hearts.is_red());
|
||||
assert!(Suit::Clubs.is_black() && Suit::Spades.is_black());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -815,11 +815,6 @@ mod tests {
|
||||
assert!(g.undo_stack_len() <= 64);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn undo_count_starts_at_zero() {
|
||||
assert_eq!(new_game().undo_count, 0);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn undo_count_increments_on_each_undo() {
|
||||
let mut g = new_game();
|
||||
@@ -900,11 +895,6 @@ mod tests {
|
||||
assert_eq!(g.score, 0);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn zen_mode_default_is_classic_via_default_trait() {
|
||||
assert_eq!(GameMode::default(), GameMode::Classic);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn zen_mode_field_persists_through_construction() {
|
||||
let g = GameState::new_with_mode(1, DrawMode::DrawThree, GameMode::Zen);
|
||||
@@ -956,12 +946,6 @@ mod tests {
|
||||
assert!(g.undo().is_ok(), "undo must be permitted in TimeAttack mode");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn time_attack_score_starts_at_zero() {
|
||||
let g = GameState::new_with_mode(42, DrawMode::DrawOne, GameMode::TimeAttack);
|
||||
assert_eq!(g.score, 0);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn time_attack_draw_three_combination() {
|
||||
// TimeAttack + DrawThree is a valid combination; verify construction.
|
||||
|
||||
Reference in New Issue
Block a user