Skip to content

Commit 29a8f70

Browse files
Test zero-length axes
1 parent b962a7b commit 29a8f70

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/arrayformat.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -239,6 +239,14 @@ mod formatting_with_omit {
239239
assert_eq!(actual_output, expected_output);
240240
}
241241

242+
#[test]
243+
fn zero_length_axes() {
244+
let a = Array3::<f32>::zeros((3, 0, 4));
245+
let actual_output = format!("{}", a);
246+
let expected_output = String::from("[[[]]]");
247+
assert_eq!(actual_output, expected_output);
248+
}
249+
242250
#[test]
243251
fn dim_0() {
244252
let element = 12;

0 commit comments

Comments
 (0)