Skip to content

Commit bbc69f6

Browse files
committed
Restore comment syntax
1 parent 34fd91c commit bbc69f6

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

src/assert.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,10 @@ macro_rules! generate_assert {
8787
($test: expr,$truth: expr,$tol: expr) => {
8888
$crate::$close($test, $truth, $tol);
8989
};
90+
($test: expr,$truth: expr,$tol: expr; $comment: expr) => {
91+
eprintln!($comment);
92+
$crate::$close($test, $truth, $tol);
93+
};
9094
}
9195
};
9296
} // generate_assert!

tests/opnorm.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ fn test(a: Array2<f64>, one: f64, inf: f64, fro: f64) {
66
println!("ONE = {:?}", a.opnorm_one());
77
println!("INF = {:?}", a.opnorm_inf());
88
println!("FRO = {:?}", a.opnorm_fro());
9-
assert_rclose!(a.opnorm_one().unwrap(), one, 1e-7);
10-
assert_rclose!(a.opnorm_inf().unwrap(), inf, 1e-7);
11-
assert_rclose!(a.opnorm_fro().unwrap(), fro, 1e-7);
9+
assert_rclose!(a.opnorm_one().unwrap(), one, 1e-7; "One norm");
10+
assert_rclose!(a.opnorm_inf().unwrap(), inf, 1e-7; "Infinity norm");
11+
assert_rclose!(a.opnorm_fro().unwrap(), fro, 1e-7; "Frobenius norm");
1212
}
1313

1414
fn gen(i: usize, j: usize, rev: bool) -> Array2<f64> {

0 commit comments

Comments
 (0)