Skip to content

Commit

Permalink
Restructure tests
Browse files Browse the repository at this point in the history
  • Loading branch information
pamelalozano16 committed Jul 19, 2023
1 parent f9dc904 commit 7c34cc9
Show file tree
Hide file tree
Showing 19 changed files with 1,195 additions and 2,247 deletions.
107 changes: 17 additions & 90 deletions spec/values/calculation/abs.hrx
Original file line number Diff line number Diff line change
Expand Up @@ -14,36 +14,34 @@ a {

<===>
================================================================================
<===> positive/integer/input.scss
<===> positive/input.scss
a {b: abs(1)}

<===> positive/integer/output.css
<===> positive/output.css
a {
b: 1;
}

<===>
================================================================================
<===> negative/decimal/input.scss
a {b: abs(-5.6px)}
<===> negative/input.scss
a {b: abs(-5.6)}

<===> negative/decimal/output.css
<===> negative/output.css
a {
b: 5.6px;
b: 5.6;
}

<===>
================================================================================
<===> operation/variable/input.scss
<===> operation/simplification/input.scss
a {
--test: 5;
b: abs(1px + 2px - var(--test))
b: abs(1px + 2px - var(--c))
}

<===> operation/variable/output.css
<===> operation/simplification/output.css
a {
--test: 5;
b: abs(3px - var(--test));
b: abs(3px - var(--c));
}

<===>
Expand All @@ -56,77 +54,6 @@ a {
b: 1.75px;
}

<===>
================================================================================
<===> operation/incompatible_units/input.scss
a {b: abs(17px * 5%)}

<===> operation/incompatible_units/error
Error: 85px*% isn't a valid CSS value.
,
1 | a {b: abs(17px * 5%)}
| ^^^^^^^^^^^^^^
'
input.scss 1:7 root stylesheet

<===>
================================================================================
<===> operation/integer/input.scss
a {b: abs(17 * 5%)}

<===> operation/integer/output.css
a {
b: 85%;
}

<===> operation/integer/warning
DEPRECATION WARNING: Passing percentage units to the global abs() function is deprecated.
In the future, this will emit a CSS abs() function to be resolved by the browser.
To preserve current behavior: math.abs(85%)
To emit a CSS abs() now: abs(#{85%})
More info: https://sass-lang.com/d/abs-percent
,
1 | a {b: abs(17 * 5%)}
| ^^^^^^^^^^^^^^^^^^^
'
input.scss 1:1 root stylesheet

<===>
================================================================================
<===> preserved/operation/percentage/input.scss
a {b: abs(17px + 5%)}

<===> preserved/operation/percentage/output.css
a {
b: abs(17px + 5%);
}

<===>
================================================================================
<===> preserved/variable/input.scss
a {
--test: 5;
b: abs(var(--test))
}

<===> preserved/variable/output.css
a {
--test: 5;
b: abs(var(--test));
}

<===>
================================================================================
<===> preserved/unquoted_string/input.scss
a {
b: abs(test);
}

<===> preserved/unquoted_string/output.css
a {
b: abs(test);
}

<===>
================================================================================
<===> named_argument/input.scss
Expand Down Expand Up @@ -183,16 +110,16 @@ More info and automated migrator: https://sass-lang.com/d/slash-div

<===>
================================================================================
<===> error/incompatible_units/input.scss
a {b: abs(17px + 4deg)}
<===> error/named_argument/variable/input.scss
a {b: abs($number: var(--c))}

<===> error/incompatible_units/error
Error: 17px and 4deg are incompatible.
<===> error/named_argument/variable/error
Error: $number: var(--c) is not a number.
,
1 | a {b: abs(17px + 4deg)}
| ^^^^^^^^^^^
1 | a {b: abs($number: var(--c))}
| ^^^^^^^^^^^^^^^^^^^^^^
'
input.scss 1:11 root stylesheet
input.scss 1:7 root stylesheet

<===>
================================================================================
Expand Down
108 changes: 37 additions & 71 deletions spec/values/calculation/acos.hrx
Original file line number Diff line number Diff line change
Expand Up @@ -14,24 +14,25 @@ a {

<===>
================================================================================
<===> negative_decimal/input.scss
a {b: acos(-0.5)}
<===> negative_one/input.scss
a {b: acos(-1)}

<===> negative_decimal/output.css
<===> negative_one/output.css
a {
b: 120deg;
b: 180deg;
}

<===>
================================================================================
<===> decimal/input.scss
a {b: acos(0.5)}
<===> zero/input.scss
a {b: acos(0)}

<===> decimal/output.css
<===> zero/output.css
a {
b: 60deg;
b: 90deg;
}


<===>
================================================================================
<===> one/input.scss
Expand All @@ -42,16 +43,6 @@ a {
b: 0deg;
}

<===>
================================================================================
<===> one_fuzzy/input.scss
a {b: acos(1.000000000001)}

<===> one_fuzzy/output.css
a {
b: calc(NaN * 1deg);
}

<===>
================================================================================
<===> greater_than_one/input.scss
Expand All @@ -64,53 +55,28 @@ a {

<===>
================================================================================
<===> preserved/percent/input.scss
a {b: acos(3px - 1.5px + 5%)}

<===> preserved/percent/output.css
a {
b: acos(1.5px + 5%);
}

<===>
================================================================================
<===> preserved/operation/variable/input.scss
<===> operation/simplification/input.scss
a {
--test: 5;
b: acos(3px - 1px + var(--test));
b: acos(3px - 1px + var(--c));
}

<===> preserved/operation/variable/output.css
<===> operation/simplification/output.css
a {
--test: 5;
b: acos(2px + var(--test));
b: acos(2px + var(--c));
}

<===>
================================================================================
<===> preserved/variable/input.scss
a {
--test: 5;
b: acos(var(--test));
}

<===> preserved/variable/output.css
a {
--test: 5;
b: acos(var(--test));
}

<===>
================================================================================
<===> preserved/unquoted_string/input.scss
a {
b: acos(test);
}
<===> error/percentage/input.scss
a {b: acos(1%)}

<===> preserved/unquoted_string/output.css
a {
b: acos(test);
}
<===> error/percentage/error
Error: Expected 1% to have no units.
,
1 | a {b: acos(1%)}
| ^^^^^^^^
'
input.scss 1:7 root stylesheet

<===>
================================================================================
Expand All @@ -125,19 +91,6 @@ Error: Expected 1px to have no units.
'
input.scss 1:7 root stylesheet

<===>
================================================================================
<===> error/percent/input.scss
a {b: acos(1%)}

<===> error/percent/error
Error: Expected 1% to have no units.
,
1 | a {b: acos(1%)}
| ^^^^^^^^
'
input.scss 1:7 root stylesheet

<===>
================================================================================
<===> error/type/input.scss
Expand All @@ -153,10 +106,10 @@ Error: Expected number, variable, function, or calculation.

<===>
================================================================================
<===> error/zero_args/input.scss
<===> error/too_few_args/input.scss
a {b: acos()}

<===> error/zero_args/error
<===> error/too_few_args/error
Error: Expected number, variable, function, or calculation.
,
1 | a {b: acos()}
Expand Down Expand Up @@ -189,3 +142,16 @@ Error: Expected identifier.
| ^
'
input.scss 1:13 root stylesheet

<===>
================================================================================
<===> error/mod/input.scss
a {b: acos(7 % 3)}

<===> error/mod/error
Error: expected "+", "-", "*", "/", or ")".
,
1 | a {b: acos(7 % 3)}
| ^
'
input.scss 1:14 root stylesheet
Loading

0 comments on commit 7c34cc9

Please sign in to comment.