From 6a13c6f32041f54ad4559e3b8d6cb19aeaebc0ff Mon Sep 17 00:00:00 2001 From: ConnorSkees <39542938+ConnorSkees@users.noreply.github.com> Date: Mon, 1 Jun 2020 21:35:23 -0400 Subject: [PATCH] at-rules are case sensitive --- src/atrule/kind.rs | 2 +- tests/if.rs | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/atrule/kind.rs b/src/atrule/kind.rs index 8764c3b..0d30411 100644 --- a/src/atrule/kind.rs +++ b/src/atrule/kind.rs @@ -72,7 +72,7 @@ pub enum AtRuleKind { impl TryFrom<&Spanned> for AtRuleKind { type Error = SassError; fn try_from(c: &Spanned) -> Result { - Ok(match c.node.to_ascii_lowercase().as_str() { + Ok(match c.node.as_str() { "use" => Self::Use, "forward" => Self::Forward, "import" => Self::Import, diff --git a/tests/if.rs b/tests/if.rs index 34bb47c..ab17cf8 100644 --- a/tests/if.rs +++ b/tests/if.rs @@ -96,7 +96,7 @@ test!( test!( uppercase_escaped_if, "@\\49 f true {\n a {\n color: red;\n }\n}\n", - "a {\n color: red;\n}\n" + "@If true {\n a {\n color: red;\n }\n}\n" ); test!( escaped_else, @@ -108,6 +108,7 @@ test!( "@if false {}\n\n@\\45lse {\n a {\n color: red;\n }\n}\n", "a {\n color: red;\n}\n" ); +test!(uppercase_if, "@If true {\n a {\n color: red;\n }\n}\n"); error!(nothing_after_if, "@if", "Error: Expected expression."); error!( nothing_after_dollar,