Simplify test result printing
This commit is contained in:
parent
f3247b2e9c
commit
6f5a56acd9
10
rust/main.rs
10
rust/main.rs
@ -30,12 +30,12 @@ fn main() {
|
|||||||
" {}: {}",
|
" {}: {}",
|
||||||
n,
|
n,
|
||||||
if expected == output {
|
if expected == output {
|
||||||
let duration = if elapsed > Duration::from_millis(10) {
|
let mut s = String::from("OK");
|
||||||
format!(" ({:?})", elapsed)
|
if elapsed > Duration::from_millis(10) {
|
||||||
} else {
|
let d = format!(" ({:?})", elapsed);
|
||||||
"".to_owned()
|
s = s + &d;
|
||||||
};
|
};
|
||||||
"OK".to_owned() + &duration
|
s
|
||||||
} else {
|
} else {
|
||||||
format!("expected {}, got {}", expected, output)
|
format!("expected {}, got {}", expected, output)
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user