diff --git a/src/parse/value/eval.rs b/src/parse/value/eval.rs index af5b0bb..e56425d 100644 --- a/src/parse/value/eval.rs +++ b/src/parse/value/eval.rs @@ -121,7 +121,6 @@ impl<'a, 'b: 'a> ValueVisitor<'a, 'b> { Value::Dimension(Some(n), u, should_divide) => { Value::Dimension(Some(-n), u, should_divide) } - // todo: NaN test Value::Dimension(None, u, should_divide) => Value::Dimension(None, u, should_divide), v => Value::String(format!("-{}", v.to_css_string(self.span)?), QuoteKind::None), }) diff --git a/tests/nan.rs b/tests/nan.rs index a937a26..21a21d7 100644 --- a/tests/nan.rs +++ b/tests/nan.rs @@ -159,3 +159,18 @@ error!( "@use \"sass:math\";\na {\n color: set-nth([a], math.acos(2), b);\n}\n", "Error: $n: NaNdeg is not an int." ); +test!( + nan_unary_negative, + "a {\n color: -(0/0);\n}\n", + "a {\n color: NaN;\n}\n" +); +test!( + nan_unary_plus, + "a {\n color: +(0/0);\n}\n", + "a {\n color: NaN;\n}\n" +); +test!( + nan_unary_div, + "a {\n color: /(0/0);\n}\n", + "a {\n color: /NaN;\n}\n" +);