diff --git a/src/parse/media.rs b/src/parse/media.rs index ff93a99..45e3865 100644 --- a/src/parse/media.rs +++ b/src/parse/media.rs @@ -36,10 +36,10 @@ impl<'a> Parser<'a> { Some(Token { kind: '=', .. }) => { if matches!(toks.peek_next(), Some(Token { kind: '=', .. })) { toks.reset_cursor(); - true + false } else { toks.reset_cursor(); - false + true } } _ => false, diff --git a/tests/media.rs b/tests/media.rs index 0b5c061..a350ce8 100644 --- a/tests/media.rs +++ b/tests/media.rs @@ -88,6 +88,26 @@ test!( }", "@media (true) {\n a {\n interpolation: in-parens;\n }\n}\n" ); +test!( + single_eq_in_query, + "@media (height=600px) { + a { + b: c + } + } + ", + "@media (height = 600px) {\n a {\n b: c;\n }\n}\n" +); +test!( + double_eq_in_query, + "@media (height==600px) { + a { + b: c + } + } + ", + "@media (false) {\n a {\n b: c;\n }\n}\n" +); error!( media_feature_missing_closing_paren, "@media foo and (bar:a", "Error: expected \")\"."