add tests for nan in unary ops
This commit is contained in:
parent
ff52e56600
commit
cb1eecde74
@ -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) => {
|
||||||
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),
|
Value::Dimension(None, u, should_divide) => Value::Dimension(None, u, should_divide),
|
||||||
v => Value::String(format!("-{}", v.to_css_string(self.span)?), QuoteKind::None),
|
v => Value::String(format!("-{}", v.to_css_string(self.span)?), QuoteKind::None),
|
||||||
})
|
})
|
||||||
|
15
tests/nan.rs
15
tests/nan.rs
@ -159,3 +159,18 @@ error!(
|
|||||||
"@use \"sass:math\";\na {\n color: set-nth([a], math.acos(2), b);\n}\n",
|
"@use \"sass:math\";\na {\n color: set-nth([a], math.acos(2), b);\n}\n",
|
||||||
"Error: $n: NaNdeg is not an int."
|
"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"
|
||||||
|
);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user