More tests, more code

This commit is contained in:
2022-06-19 23:52:52 +02:00
parent c9d9d59535
commit 0efb0312da
3 changed files with 472 additions and 121 deletions

View File

@@ -24,12 +24,12 @@ impl Game {
) -> Self {
assert!(
(result.is_empty() || result.len() == teams.len()),
"result.must be empty or the same length as teams"
"result must be empty or the same length as teams"
);
assert!(
(weights.is_empty() || weights.len() == teams.len()),
"weights.must be empty or the same length as teams"
"weights must be empty or the same length as teams"
);
assert!(
@@ -38,7 +38,7 @@ impl Game {
.iter()
.zip(teams.iter())
.all(|(w, t)| w.len() == t.len()),
"weights.must be empty or has the same dimensions as teams"
"weights must be empty or has the same dimensions as teams"
);
assert!(
@@ -52,7 +52,7 @@ impl Game {
r.sort_unstable_by(|a, b| a.partial_cmp(b).unwrap());
r.windows(2).all(|w| w[0] != w[1])
},
"draw.must be > 0.0 if there is teams with draw"
"draw must be > 0.0 if there is teams with draw"
);
if result.is_empty() {