Panic when invalid overflow value is returned

This commit is contained in:
est31 2017-02-04 01:39:19 +01:00
parent b78e956f08
commit f8a4e3fd70
1 changed files with 3 additions and 3 deletions

View File

@ -102,7 +102,7 @@ mod tests {
let mut overflow = 2;
let r = f(a, b, &mut overflow);
if overflow != 0 && overflow != 1 {
return None
panic!("Invalid value {} for overflow", overflow);
}
Some((r, overflow))
}
@ -114,7 +114,7 @@ mod tests {
let mut overflow = 2;
let r = f(a, b, &mut overflow);
if overflow != 0 && overflow != 1 {
return None
panic!("Invalid value {} for overflow", overflow);
}
Some((r, overflow))
}
@ -138,7 +138,7 @@ mod tests_i128 {
let mut overflow = 2;
let r = f(a, b, &mut overflow);
if overflow != 0 && overflow != 1 {
return None
panic!("Invalid value {} for overflow", overflow);
}
Some((r, overflow))
}