Skip to content

Commit 34fd91c

Browse files
committed
Add assertion for array sizes
1 parent 51f32ee commit 34fd91c

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/assert.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ where
3535
D: Dimension,
3636
D::Pattern: PartialEq + Debug,
3737
{
38+
assert_eq!(test.dim(), truth.dim());
3839
let tol = (test - truth).norm_max();
3940
if tol > atol {
4041
eprintln!("Expected:\n{}", truth);
@@ -52,6 +53,7 @@ where
5253
D: Dimension,
5354
D::Pattern: PartialEq + Debug,
5455
{
56+
assert_eq!(test.dim(), truth.dim());
5557
let tol = (test - truth).norm_l1() / truth.norm_l1();
5658
if tol > rtol {
5759
eprintln!("Expected:\n{}", truth);
@@ -69,6 +71,7 @@ where
6971
D: Dimension,
7072
D::Pattern: PartialEq + Debug,
7173
{
74+
assert_eq!(test.dim(), truth.dim());
7275
let tol = (test - truth).norm_l2() / truth.norm_l2();
7376
if tol > rtol {
7477
eprintln!("Expected:\n{}", truth);

0 commit comments

Comments
 (0)