MCPcopy Create free account
hub / github.com/daniel-e/rustml / test_add_row

Function test_add_row

src/matrix.rs:1191–1205  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1189
1190 #[test]
1191 fn test_add_row() {
1192
1193 let mut m = Matrix::<i32>::new();
1194 assert_eq!(m.rows(), 0);
1195 assert_eq!(m.cols(), 0);
1196 m.add_row(&vec![1, 2, 3]);
1197 assert_eq!(m.rows(), 1);
1198 assert_eq!(m.cols(), 3);
1199 m.add_row(&vec![4, 5, 6]);
1200 assert_eq!(m.rows(), 2);
1201 assert_eq!(m.cols(), 3);
1202
1203 assert_eq!(m.row(0).unwrap().to_vec(), vec![1, 2, 3]);
1204 assert_eq!(m.row(1).unwrap().to_vec(), vec![4, 5, 6]);
1205 }
1206
1207 #[test]
1208 fn test_push_matrix_below() {

Callers

nothing calls this directly

Calls 1

add_rowMethod · 0.80

Tested by

no test coverage detected