File tree Expand file tree Collapse file tree 2 files changed +18
-0
lines changed
Expand file tree Collapse file tree 2 files changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -23770,6 +23770,18 @@ mod tests {
2377023770 )
2377123771 }
2377223772
23773+ #[test]
23774+ fn test_invalid() {
23775+ error_test(
23776+ ".a{color: hsla(120, 62.32%;}",
23777+ ParserError::UnexpectedToken(Token::CloseCurlyBracket),
23778+ );
23779+ error_test(
23780+ ".a{--foo: url(foo\\) b\\)ar)}",
23781+ ParserError::UnexpectedToken(Token::BadUrl("foo\\) b\\)ar".into())),
23782+ );
23783+ }
23784+
2377323785 #[test]
2377423786 fn test_container_queries() {
2377523787 // with name
Original file line number Diff line number Diff line change @@ -430,6 +430,12 @@ impl<'i> TokenList<'i> {
430430 last_is_delim = false ;
431431 last_is_whitespace = false ;
432432 }
433+ Ok ( token) if token. is_parse_error ( ) => {
434+ return Err ( ParseError {
435+ kind : ParseErrorKind :: Basic ( BasicParseErrorKind :: UnexpectedToken ( token. clone ( ) ) ) ,
436+ location : state. source_location ( ) ,
437+ } )
438+ }
433439 Ok ( token) => {
434440 last_is_delim = matches ! ( token, cssparser:: Token :: Delim ( _) | cssparser:: Token :: Comma ) ;
435441
You can’t perform that action at this time.
0 commit comments