test: proptest with too many objects

This commit is contained in:
MaxOhn
2023-11-03 14:30:08 +01:00
parent 383ca169dd
commit 21bf030690
6 changed files with 23 additions and 14 deletions
+8 -6
View File
@@ -966,6 +966,8 @@ mod tests {
n_misses: usize,
best_case: bool,
) -> ManiaScoreState {
let n_misses = n_misses.min(N_OBJECTS);
let mut best_state = ManiaScoreState {
n_misses,
..Default::default()
@@ -1165,12 +1167,12 @@ mod tests {
#[test]
fn mania_hitresults(
acc in 0.0..=1.0,
n320 in option::weighted(0.10, 0_usize..=N_OBJECTS),
n300 in option::weighted(0.10, 0_usize..=N_OBJECTS),
n200 in option::weighted(0.10, 0_usize..=N_OBJECTS),
n100 in option::weighted(0.10, 0_usize..=N_OBJECTS),
n50 in option::weighted(0.10, 0_usize..=N_OBJECTS),
n_misses in option::weighted(0.15, 0_usize..=N_OBJECTS),
n320 in option::weighted(0.10, 0_usize..=N_OBJECTS + 10),
n300 in option::weighted(0.10, 0_usize..=N_OBJECTS + 10),
n200 in option::weighted(0.10, 0_usize..=N_OBJECTS + 10),
n100 in option::weighted(0.10, 0_usize..=N_OBJECTS + 10),
n50 in option::weighted(0.10, 0_usize..=N_OBJECTS + 10),
n_misses in option::weighted(0.15, 0_usize..=N_OBJECTS + 10),
best_case in prop::bool::ANY,
) {
let (map, attrs) = test_data();
+7 -5
View File
@@ -848,6 +848,8 @@ mod test {
n_misses: usize,
best_case: bool,
) -> OsuScoreState {
let n_misses = n_misses.min(N_OBJECTS);
let mut best_state = OsuScoreState {
n_misses,
..Default::default()
@@ -929,10 +931,10 @@ mod test {
#[test]
fn osu_hitresults(
acc in 0.0..=1.0,
n300 in option::weighted(0.10, 0_usize..=N_OBJECTS),
n100 in option::weighted(0.10, 0_usize..=N_OBJECTS),
n50 in option::weighted(0.10, 0_usize..=N_OBJECTS),
n_misses in option::weighted(0.15, 0_usize..=N_OBJECTS),
n300 in option::weighted(0.10, 0_usize..=N_OBJECTS + 10),
n100 in option::weighted(0.10, 0_usize..=N_OBJECTS + 10),
n50 in option::weighted(0.10, 0_usize..=N_OBJECTS + 10),
n_misses in option::weighted(0.15, 0_usize..=N_OBJECTS + 10),
best_case in prop::bool::ANY,
) {
let (map, attrs) = test_data();
@@ -975,7 +977,7 @@ mod test {
n_misses.unwrap_or(0),
best_case,
);
expected.max_combo = max_combo.saturating_sub(n_misses.unwrap_or(0));
expected.max_combo = max_combo.saturating_sub(n_misses.map_or(0, |n| n.min(N_OBJECTS)));
assert_eq!(state, expected);
}
+5 -3
View File
@@ -573,6 +573,8 @@ mod test {
n_misses: usize,
best_case: bool,
) -> TaikoScoreState {
let n_misses = n_misses.min(MAX_COMBO);
let mut best_state = TaikoScoreState {
n_misses,
..Default::default()
@@ -626,9 +628,9 @@ mod test {
#[test]
fn taiko_hitresults(
acc in 0.0..=1.0,
n300 in option::weighted(0.10, 0_usize..=MAX_COMBO),
n100 in option::weighted(0.10, 0_usize..=MAX_COMBO),
n_misses in option::weighted(0.15, 0_usize..=MAX_COMBO),
n300 in option::weighted(0.10, 0_usize..=MAX_COMBO + 10),
n100 in option::weighted(0.10, 0_usize..=MAX_COMBO + 10),
n_misses in option::weighted(0.15, 0_usize..=MAX_COMBO + 10),
best_case in prop::bool::ANY,
) {
let (map, attrs) = test_data();