test: assert only relevant values
This commit is contained in:
+4
-13
@@ -552,21 +552,12 @@ mod test {
|
|||||||
let (map, attrs) = DATA.get_or_init(|| {
|
let (map, attrs) = DATA.get_or_init(|| {
|
||||||
let path = "./maps/2118524.osu";
|
let path = "./maps/2118524.osu";
|
||||||
let map = Beatmap::from_path(path).unwrap();
|
let map = Beatmap::from_path(path).unwrap();
|
||||||
|
|
||||||
let attrs = CatchStars::new(&map).calculate();
|
let attrs = CatchStars::new(&map).calculate();
|
||||||
|
|
||||||
let expected = CatchDifficultyAttributes {
|
assert_eq!(
|
||||||
stars: 3.2502669316166624,
|
(N_FRUITS, N_DROPLETS, N_TINY_DROPLETS),
|
||||||
ar: 8.0,
|
(attrs.n_fruits, attrs.n_droplets, attrs.n_tiny_droplets)
|
||||||
n_fruits: 728,
|
);
|
||||||
n_droplets: 2,
|
|
||||||
n_tiny_droplets: 291,
|
|
||||||
};
|
|
||||||
|
|
||||||
assert_eq!(attrs, expected);
|
|
||||||
assert_eq!(N_FRUITS, attrs.n_fruits);
|
|
||||||
assert_eq!(N_DROPLETS, attrs.n_droplets);
|
|
||||||
assert_eq!(N_TINY_DROPLETS, attrs.n_tiny_droplets);
|
|
||||||
|
|
||||||
(map, attrs)
|
(map, attrs)
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -930,16 +930,8 @@ mod tests {
|
|||||||
let (map, attrs) = DATA.get_or_init(|| {
|
let (map, attrs) = DATA.get_or_init(|| {
|
||||||
let path = "./maps/1638954.osu";
|
let path = "./maps/1638954.osu";
|
||||||
let map = Beatmap::from_path(path).unwrap();
|
let map = Beatmap::from_path(path).unwrap();
|
||||||
|
|
||||||
let attrs = ManiaStars::new(&map).calculate();
|
let attrs = ManiaStars::new(&map).calculate();
|
||||||
|
|
||||||
let expected = ManiaDifficultyAttributes {
|
|
||||||
stars: 3.441830819988125,
|
|
||||||
hit_window: 40.0,
|
|
||||||
max_combo: 956,
|
|
||||||
};
|
|
||||||
|
|
||||||
assert_eq!(attrs, expected);
|
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
N_OBJECTS,
|
N_OBJECTS,
|
||||||
(map.n_circles + map.n_sliders + map.n_spinners) as usize
|
(map.n_circles + map.n_sliders + map.n_spinners) as usize
|
||||||
@@ -1250,7 +1242,6 @@ mod tests {
|
|||||||
};
|
};
|
||||||
|
|
||||||
assert_eq!(state, expected);
|
assert_eq!(state, expected);
|
||||||
assert_eq!(state.total_hits(), N_OBJECTS);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
@@ -1275,6 +1266,5 @@ mod tests {
|
|||||||
};
|
};
|
||||||
|
|
||||||
assert_eq!(state, expected);
|
assert_eq!(state, expected);
|
||||||
assert_eq!(state.total_hits(), N_OBJECTS);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+5
-19
@@ -805,29 +805,15 @@ mod test {
|
|||||||
let (map, attrs) = DATA.get_or_init(|| {
|
let (map, attrs) = DATA.get_or_init(|| {
|
||||||
let path = "./maps/2785319.osu";
|
let path = "./maps/2785319.osu";
|
||||||
let map = Beatmap::from_path(path).unwrap();
|
let map = Beatmap::from_path(path).unwrap();
|
||||||
|
|
||||||
let attrs = OsuStars::new(&map).calculate();
|
let attrs = OsuStars::new(&map).calculate();
|
||||||
|
|
||||||
let expected = OsuDifficultyAttributes {
|
|
||||||
aim: 2.8693628443424104,
|
|
||||||
speed: 2.533869745015772,
|
|
||||||
flashlight: 2.288770487900865,
|
|
||||||
slider_factor: 0.9803052946037858,
|
|
||||||
speed_note_count: 210.36373973116545,
|
|
||||||
ar: 9.300000190734863,
|
|
||||||
od: 8.800000190734863,
|
|
||||||
hp: 5.0,
|
|
||||||
n_circles: 307,
|
|
||||||
n_sliders: 293,
|
|
||||||
n_spinners: 1,
|
|
||||||
stars: 5.669858729379628,
|
|
||||||
max_combo: 909,
|
|
||||||
};
|
|
||||||
|
|
||||||
assert_eq!(attrs, expected);
|
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
|
(attrs.n_circles, attrs.n_sliders, attrs.n_spinners),
|
||||||
|
(307, 293, 1)
|
||||||
|
);
|
||||||
|
assert_eq!(
|
||||||
|
attrs.n_circles + attrs.n_sliders + attrs.n_spinners,
|
||||||
N_OBJECTS,
|
N_OBJECTS,
|
||||||
attrs.n_circles + attrs.n_sliders + attrs.n_spinners
|
|
||||||
);
|
);
|
||||||
|
|
||||||
(map, attrs)
|
(map, attrs)
|
||||||
|
|||||||
@@ -540,20 +540,8 @@ mod test {
|
|||||||
let (map, attrs) = DATA.get_or_init(|| {
|
let (map, attrs) = DATA.get_or_init(|| {
|
||||||
let path = "./maps/1028484.osu";
|
let path = "./maps/1028484.osu";
|
||||||
let map = Beatmap::from_path(path).unwrap();
|
let map = Beatmap::from_path(path).unwrap();
|
||||||
|
|
||||||
let attrs = TaikoStars::new(&map).calculate();
|
let attrs = TaikoStars::new(&map).calculate();
|
||||||
|
|
||||||
let expected = TaikoDifficultyAttributes {
|
|
||||||
stamina: 1.4528845068865617,
|
|
||||||
rhythm: 0.20130047251681948,
|
|
||||||
colour: 1.0487315549761433,
|
|
||||||
peak: 1.8881824429738323,
|
|
||||||
hit_window: 35.0,
|
|
||||||
stars: 2.9778030386845606,
|
|
||||||
max_combo: 289,
|
|
||||||
};
|
|
||||||
|
|
||||||
assert_eq!(attrs, expected);
|
|
||||||
assert_eq!(MAX_COMBO, attrs.max_combo);
|
assert_eq!(MAX_COMBO, attrs.max_combo);
|
||||||
|
|
||||||
(map, attrs)
|
(map, attrs)
|
||||||
|
|||||||
Reference in New Issue
Block a user