ddr::ssq: Fix difficulty display
Tests don’t help if they are wrong
This commit is contained in:
parent
1803ba0092
commit
3ab224414f
|
@ -419,11 +419,11 @@ impl fmt::Display for Level {
|
||||||
_ => "Unknown Number of Players",
|
_ => "Unknown Number of Players",
|
||||||
};
|
};
|
||||||
let difficulty = match self.difficulty {
|
let difficulty = match self.difficulty {
|
||||||
|
0 => "Beginner",
|
||||||
1 => "Basic",
|
1 => "Basic",
|
||||||
2 => "Difficult",
|
2 => "Difficult",
|
||||||
3 => "Expert",
|
3 => "Expert",
|
||||||
4 => "Beginner",
|
4 => "Challenge",
|
||||||
6 => "Challenge",
|
|
||||||
_ => "Unknown Difficulty",
|
_ => "Unknown Difficulty",
|
||||||
};
|
};
|
||||||
write!(f, "{} {}", players, difficulty)
|
write!(f, "{} {}", players, difficulty)
|
||||||
|
@ -678,11 +678,11 @@ mod tests {
|
||||||
#[test]
|
#[test]
|
||||||
fn test_difficulty_display() {
|
fn test_difficulty_display() {
|
||||||
let values = [
|
let values = [
|
||||||
|
("Single Beginner", 0, 1),
|
||||||
("Double Basic", 1, 2),
|
("Double Basic", 1, 2),
|
||||||
("Single Difficult", 2, 1),
|
("Single Difficult", 2, 1),
|
||||||
("Double Expert", 3, 2),
|
("Double Expert", 3, 2),
|
||||||
("Single Beginner", 4, 1),
|
("Double Challenge", 4, 2),
|
||||||
("Double Challenge", 6, 2),
|
|
||||||
("Unknown Number of Players Unknown Difficulty", 5, 3),
|
("Unknown Number of Players Unknown Difficulty", 5, 3),
|
||||||
("Unknown Number of Players Unknown Difficulty", 7, 0),
|
("Unknown Number of Players Unknown Difficulty", 7, 0),
|
||||||
];
|
];
|
||||||
|
|
Reference in a new issue