@@ -111,7 +111,7 @@ mod vm_tests {
111111 ( $selectors: expr) => { {
112112 let mut ast = Ast :: default ( ) ;
113113
114- for ( selector, match_id) in $selectors. iter ( ) . zip( 0 ..) {
114+ for ( selector, match_id) in $selectors. into_iter ( ) . zip( 0 ..) {
115115 ast. add_selector( & selector. parse( ) . unwrap( ) , match_id) ;
116116 }
117117
@@ -133,7 +133,7 @@ mod vm_tests {
133133
134134 {
135135 let mut match_handler = |m: MatchInfo | {
136- assert_eq!( m. with_content, $expectation. should_match_with_content) ;
136+ assert_eq!( m. with_content, $expectation. should_match_with_content, "with_content" ) ;
137137 matched_ids. insert( m. match_id) ;
138138 } ;
139139
@@ -168,7 +168,7 @@ mod vm_tests {
168168 }
169169 }
170170
171- assert_eq!( matched_ids, $expectation. matched_ids) ;
171+ assert_eq!( matched_ids, $expectation. matched_ids, "{:?}" , matched_ids . iter ( ) . collect :: < Vec <_>> ( ) ) ;
172172 }
173173 _ => panic!( "Start tag expected" ) ,
174174 }
@@ -1219,6 +1219,26 @@ mod vm_tests {
12191219 ) ;
12201220 }
12211221
1222+ #[ test]
1223+ fn lots_of_selectors ( ) {
1224+ let mut vm = create_vm ! (
1225+ ( 'a' ..='z' ) . map( |c| c. to_string( ) )
1226+ . chain( ( 'A' ..='Z' ) . map( |c| format!( "#{c}" ) ) )
1227+ . chain( ( '0' ..='9' ) . map( |c| format!( "[data{c}]" ) ) )
1228+ ) ;
1229+
1230+ exec_for_start_tag_and_assert ! (
1231+ vm,
1232+ "<a id=Z>" ,
1233+ Namespace :: Html ,
1234+ Expectation {
1235+ should_bailout: true ,
1236+ should_match_with_content: true ,
1237+ matched_ids: DenseHashSet :: from( [ 0 , 51 ] ) ,
1238+ }
1239+ ) ;
1240+ }
1241+
12221242 /// Test that match_handler is called exactly once per matched id,
12231243 /// even when the same match_ids can be reached through multiple instruction paths.
12241244 /// For example, `"span, [foo$=bar]"` is one selector (match_id 0) with two
0 commit comments