improve sorting test

This commit is contained in:
Evan Almloff 2023-02-12 17:36:00 -06:00
parent abd6132c03
commit f652ac5e13

View file

@ -40,14 +40,25 @@ fn sorting() {
(0, &[0, 1]), (0, &[0, 1]),
(1, &[0, 2]), (1, &[0, 2]),
(2, &[1, 0]), (2, &[1, 0]),
(4, &[1, 1]), (3, &[1, 0, 1]),
(3, &[1, 2]), (4, &[1, 2]),
]; ];
assert_eq!( assert_eq!(
sort_bfs(&[&[0, 1,], &[0, 2,], &[1, 0,], &[1, 2,], &[1, 1,],]), sort_bfs(&[&[0, 1,], &[0, 2,], &[1, 0,], &[1, 0, 1,], &[1, 2,],]),
r
);
let r: [(usize, &[u8]); 6] = [
(0, &[0]),
(1, &[0, 1]),
(2, &[0, 1, 2]),
(3, &[1]),
(4, &[1, 2]),
(5, &[2]),
];
assert_eq!(
sort_bfs(&[&[0], &[0, 1], &[0, 1, 2], &[1], &[1, 2], &[2],]),
r r
); );
assert!(matches!(&[0], &[_, ..]))
} }
impl<'b> VirtualDom { impl<'b> VirtualDom {