Add test for formatting of empty matrix
This commit is contained in:
parent
7bc91d3c68
commit
6df81c2292
|
@ -80,7 +80,7 @@ fn iter() {
|
|||
#[test]
|
||||
fn debug_output_semicolon_delimited_rowwise() {
|
||||
let m = Matrix2::new(1.0, 2.0, 3.0, 4.0);
|
||||
let expected_output = "[1.0, 2.0; 3.0, 4.0]"; // Current output on the nightly channel.
|
||||
let expected_output = "[1.0, 2.0; 3.0, 4.0]";
|
||||
let current_output = format!("{:?}", m);
|
||||
dbg!(expected_output);
|
||||
dbg!(¤t_output);
|
||||
|
@ -88,6 +88,18 @@ fn debug_output_semicolon_delimited_rowwise() {
|
|||
assert!(current_output == expected_output);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn format_empty_matrix() {
|
||||
let empty_row: [f32; 0] = [];
|
||||
let m = na::DMatrix::from_row_slice(0, 0, &empty_row);
|
||||
let expected_output = "[ ]";
|
||||
let current_output = format!("{}", m);
|
||||
dbg!(expected_output);
|
||||
dbg!(¤t_output);
|
||||
|
||||
assert!(current_output == expected_output);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn is_column_major() {
|
||||
let a = Matrix2x3::new(1.0, 2.0, 3.0, 4.0, 5.0, 6.0);
|
||||
|
|
Loading…
Reference in New Issue