File tree Expand file tree Collapse file tree 1 file changed +17
-1
lines changed
Expand file tree Collapse file tree 1 file changed +17
-1
lines changed Original file line number Diff line number Diff line change @@ -72,7 +72,20 @@ fn test_collect_edge_diff_iterators() {
7272 }
7373
7474 let removals = diffs. iter ( ) . flat_map ( |d| d. removals ( ) ) . collect :: < Vec < _ > > ( ) ;
75- let insertions = diffs. iter ( ) . map ( |i| i. insertions ( ) ) . collect :: < Vec < _ > > ( ) ;
75+ let insertions = diffs
76+ . iter ( )
77+ . flat_map ( |d| d. insertions ( ) )
78+ . collect :: < Vec < _ > > ( ) ;
79+ assert_eq ! ( insertions. len( ) , ts. edge_insertion_order( ) . len( ) ) ;
80+ for ( i, j) in insertions. iter ( ) . zip ( ts. edge_insertion_order ( ) . iter ( ) ) {
81+ assert_eq ! (
82+ i. parent( ) ,
83+ ts. tables( ) . edges( ) . parent_column( ) [ j. as_usize( ) ]
84+ ) ;
85+ assert_eq ! ( i. child( ) , ts. tables( ) . edges( ) . child_column( ) [ j. as_usize( ) ] ) ;
86+ assert_eq ! ( i. left( ) , ts. tables( ) . edges( ) . left_column( ) [ j. as_usize( ) ] ) ;
87+ assert_eq ! ( i. right( ) , ts. tables( ) . edges( ) . right_column( ) [ j. as_usize( ) ] ) ;
88+ }
7689
7790 let removal_order = ts. edge_removal_order ( ) ;
7891 // Removals have some nuance:
@@ -92,5 +105,8 @@ fn test_collect_edge_diff_iterators() {
92105 i. parent( ) ,
93106 ts. tables( ) . edges( ) . parent_column( ) [ j. as_usize( ) ]
94107 ) ;
108+ assert_eq ! ( i. child( ) , ts. tables( ) . edges( ) . child_column( ) [ j. as_usize( ) ] ) ;
109+ assert_eq ! ( i. left( ) , ts. tables( ) . edges( ) . left_column( ) [ j. as_usize( ) ] ) ;
110+ assert_eq ! ( i. right( ) , ts. tables( ) . edges( ) . right_column( ) [ j. as_usize( ) ] ) ;
95111 }
96112}
You can’t perform that action at this time.
0 commit comments