Skip to content

Commit 88d53e3

Browse files
Add a test to specify behaviour for zero-dimensional arrays
1 parent 6c636dc commit 88d53e3

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/arrayformat.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -231,6 +231,15 @@ mod formatting_with_omit {
231231
println!("Expected output:\n{}\nActual output:\n{}", expected, actual);
232232
}
233233

234+
#[test]
235+
fn dim_0() {
236+
let element = 12;
237+
let a = arr0(element);
238+
let actual_output = format!("{}", a);
239+
let expected_output = format!("{}", element);
240+
assert_eq!(actual_output, expected_output);
241+
}
242+
234243
#[test]
235244
fn dim_1() {
236245
let overflow: usize = 5;

0 commit comments

Comments
 (0)