File tree Expand file tree Collapse file tree 2 files changed +10
-1
lines changed Expand file tree Collapse file tree 2 files changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -970,6 +970,15 @@ fn parser_maintains_current_line() {
970
970
assert_eq ! ( parser. current_line( ) , "ident" ) ;
971
971
}
972
972
973
+ #[ test]
974
+ fn cdc_regression_test ( ) {
975
+ let mut input = ParserInput :: new ( "-->x" ) ;
976
+ let mut parser = Parser :: new ( & mut input) ;
977
+ parser. skip_cdc_and_cdo ( ) ;
978
+ assert_eq ! ( parser. next( ) , Ok ( & Token :: Ident ( "x" . into( ) ) ) ) ;
979
+ assert_eq ! ( parser. next( ) , Err ( BasicParseError :: EndOfInput ) ) ;
980
+ }
981
+
973
982
#[ test]
974
983
fn parse_entirely_reports_first_error ( ) {
975
984
#[ derive( PartialEq , Debug ) ]
Original file line number Diff line number Diff line change @@ -470,7 +470,7 @@ impl<'a> Tokenizer<'a> {
470
470
}
471
471
b'-' => {
472
472
if self . starts_with( b"-->" ) {
473
- self . advance( 4 )
473
+ self . advance( 3 )
474
474
} else {
475
475
return
476
476
}
You can’t perform that action at this time.
0 commit comments