Add tests for precision rounding

This commit is contained in:
ConnorSkees 2020-03-17 10:28:00 -04:00
parent 42787ec700
commit 1c4be96f73
2 changed files with 12 additions and 5 deletions

View File

@ -84,11 +84,6 @@ test!(
"a {\n color: unit(1)\n}\n",
"a {\n color: \"\";\n}\n"
);
test!(
unit_non_numeric,
"a {\n color: unit(red)\n}\n",
"a {\n color: \"\";\n}\n"
);
test!(
unit_named_args,
"a {\n color: unit($number: 1px)\n}\n",

View File

@ -46,3 +46,15 @@ test!(
"a {\n color: red; ;\n}\n",
"a {\n color: red;\n}\n"
);
// these two precisiont tests only act like this in dart sass
// these values are `1` for libsass
test!(
precision_does_not_round_up,
"a {\n color: 0.99999999991;\n}\n",
"a {\n color: 0.9999999999;\n}\n"
);
test!(
precision_does_round_up,
"a {\n color: 1.00000000009;\n}\n",
"a {\n color: 1.0000000001;\n}\n"
);