Skip to content

Commit

Permalink
fix: guaranteed crit branch tests only check length of instructions
Browse files Browse the repository at this point in the history
vectors

these are testing that it doesn't branch, but wickedblow (and crits themselves) do a different amount of damage in different generations
  • Loading branch information
pmariglia committed Dec 28, 2024
1 parent 16269e2 commit 02ca5cf
Showing 1 changed file with 4 additions and 42 deletions.
46 changes: 4 additions & 42 deletions tests/test_battle_mechanics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -202,14 +202,7 @@ fn test_wickedblow_always_crits_without_a_branch() {
true,
);

let expected_instructions = vec![StateInstructions {
percentage: 100.0,
instruction_list: vec![Instruction::Damage(DamageInstruction {
side_ref: SideReference::SideTwo,
damage_amount: 89,
})],
}];
assert_eq!(expected_instructions, vec_of_instructions);
assert_eq!(1, vec_of_instructions.len());
}

#[test]
Expand Down Expand Up @@ -237,14 +230,7 @@ fn test_wickedblow_always_ignores_defensive_boost_on_opponent_because_of_crit()
true,
);

let expected_instructions = vec![StateInstructions {
percentage: 100.0,
instruction_list: vec![Instruction::Damage(DamageInstruction {
side_ref: SideReference::SideTwo,
damage_amount: 89,
})],
}];
assert_eq!(expected_instructions, vec_of_instructions);
assert_eq!(1, vec_of_instructions.len());
}

#[test]
Expand Down Expand Up @@ -272,14 +258,7 @@ fn test_wickedblow_cannot_crit_on_shellarmor() {
true,
);

let expected_instructions = vec![StateInstructions {
percentage: 100.0,
instruction_list: vec![Instruction::Damage(DamageInstruction {
side_ref: SideReference::SideTwo,
damage_amount: 60,
})],
}];
assert_eq!(expected_instructions, vec_of_instructions);
assert_eq!(1, vec_of_instructions.len());
}

#[test]
Expand All @@ -306,24 +285,7 @@ fn test_surgingstrikes_always_crits_without_a_branch() {
true,
);

let expected_instructions = vec![StateInstructions {
percentage: 100.0,
instruction_list: vec![
Instruction::Damage(DamageInstruction {
side_ref: SideReference::SideTwo,
damage_amount: 31,
}),
Instruction::Damage(DamageInstruction {
side_ref: SideReference::SideTwo,
damage_amount: 31,
}),
Instruction::Damage(DamageInstruction {
side_ref: SideReference::SideTwo,
damage_amount: 31,
}),
],
}];
assert_eq!(expected_instructions, vec_of_instructions);
assert_eq!(1, vec_of_instructions.len());
}

#[test]
Expand Down

0 comments on commit 02ca5cf

Please sign in to comment.