More tests, more code
This commit is contained in:
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user