Skip to content

Commit b962a7b

Browse files
Add a test for empty arrays
1 parent 88d53e3 commit b962a7b

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
@@ -231,6 +231,14 @@ mod formatting_with_omit {
231231
println!("Expected output:\n{}\nActual output:\n{}", expected, actual);
232232
}
233233

234+
#[test]
235+
fn empty_arrays() {
236+
let a: Array2<u32> = arr2(&[[], []]);
237+
let actual_output = format!("{}", a);
238+
let expected_output = String::from("[[]]");
239+
assert_eq!(actual_output, expected_output);
240+
}
241+
234242
#[test]
235243
fn dim_0() {
236244
let element = 12;

0 commit comments

Comments
 (0)