Skip to content

Commit 790ec46

Browse files
authored
Revert "Calc functions tests (#1912)" (#1931)
This reverts commit bac935b.
1 parent bac935b commit 790ec46

29 files changed

+89
-4976
lines changed

spec/core_functions/math/abs.hrx

Lines changed: 27 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,5 @@
1-
<===> options.yml
2-
---
3-
:ignore_for:
4-
- libsass
5-
6-
<===>
7-
================================================================================
81
<===> zero/input.scss
9-
@use "sass:math";
10-
a {b: math.abs(0)}
2+
a {b: abs(0)}
113

124
<===> zero/output.css
135
a {
@@ -17,8 +9,7 @@ a {
179
<===>
1810
================================================================================
1911
<===> positive/integer/input.scss
20-
@use "sass:math";
21-
a {b: math.abs(1)}
12+
a {b: abs(1)}
2213

2314
<===> positive/integer/output.css
2415
a {
@@ -28,8 +19,7 @@ a {
2819
<===>
2920
================================================================================
3021
<===> positive/decimal/input.scss
31-
@use "sass:math";
32-
a {b: math.abs(5.6)}
22+
a {b: abs(5.6)}
3323

3424
<===> positive/decimal/output.css
3525
a {
@@ -39,8 +29,7 @@ a {
3929
<===>
4030
================================================================================
4131
<===> negative/integer/input.scss
42-
@use "sass:math";
43-
a {b: math.abs(-17)}
32+
a {b: abs(-17)}
4433

4534
<===> negative/integer/output.css
4635
a {
@@ -50,8 +39,7 @@ a {
5039
<===>
5140
================================================================================
5241
<===> negative/decimal/input.scss
53-
@use "sass:math";
54-
a {b: math.abs(-123.456)}
42+
a {b: abs(-123.456)}
5543

5644
<===> negative/decimal/output.css
5745
a {
@@ -65,8 +53,7 @@ a {
6553
- sass/libsass#2887
6654

6755
<===> preserves_units/input.scss
68-
@use "sass:math";
69-
a {b: math.abs(-7px / 4em) * 1em}
56+
a {b: abs(-7px / 4em) * 1em}
7057

7158
<===> preserves_units/output.css
7259
a {
@@ -81,16 +68,15 @@ Recommendation: math.div(-7px, 4em)
8168
More info and automated migrator: https://sass-lang.com/d/slash-div
8269

8370
,
84-
2 | a {b: math.abs(-7px / 4em) * 1em}
85-
| ^^^^^^^^^^
71+
1 | a {b: abs(-7px / 4em) * 1em}
72+
| ^^^^^^^^^^
8673
'
87-
input.scss 2:16 root stylesheet
74+
input.scss 1:11 root stylesheet
8875

8976
<===>
9077
================================================================================
9178
<===> named/input.scss
92-
@use "sass:math";
93-
a { b: math.abs($number: 3)}
79+
a {b: abs($number: -3)}
9480

9581
<===> named/output.css
9682
a {
@@ -100,71 +86,69 @@ a {
10086
<===>
10187
================================================================================
10288
<===> error/type/input.scss
103-
@use "sass:math";
104-
a {b: math.abs(c)}
89+
a {b: abs(c)}
10590

10691
<===> error/type/error
10792
Error: $number: c is not a number.
10893
,
109-
2 | a {b: math.abs(c)}
110-
| ^^^^^^^^^^^
94+
1 | a {b: abs(c)}
95+
| ^^^^^^
11196
'
112-
input.scss 2:7 root stylesheet
97+
input.scss 1:7 root stylesheet
11398

11499
<===> error/type/error-libsass
115-
Error: argument `$number` of `math.abs($number)` must be a number
100+
Error: argument `$number` of `abs($number)` must be a number
116101
on line 1:7 of input.scss, in function `round`
117102
from line 1:7 of input.scss
118-
>> a {b: math.abs(c)}
103+
>> a {b: abs(c)}
119104

120105
------^
121106

122107
<===>
123108
================================================================================
124109
<===> error/too_few_args/input.scss
125-
@use "sass:math";
126-
a {b: math.abs()}
110+
a {b: abs()}
127111

128112
<===> error/too_few_args/error
129113
Error: Missing argument $number.
130114
,--> input.scss
131-
2 | a {b: math.abs()}
132-
| ^^^^^^^^^^ invocation
115+
1 | a {b: abs()}
116+
| ^^^^^ invocation
133117
'
134118
,--> sass:math
135119
1 | @function abs($number) {
136120
| ============ declaration
137121
'
138-
input.scss 2:7 root stylesheet
122+
input.scss 1:7 root stylesheet
139123

140124
<===> error/too_few_args/error-libsass
141125
Error: Function abs is missing argument $number.
142126
on line 1 of input.scss
143-
>> a {b: math.abs()}
127+
>> a {b: abs()}
144128

145129
------^
146130

147131
<===>
148132
================================================================================
149133
<===> error/too_many_args/input.scss
150-
@use "sass:math";
151-
a {b: math.abs(1, 2)}
134+
a {b: abs(1, 2)}
135+
152136

153137
<===> error/too_many_args/error
154138
Error: Only 1 argument allowed, but 2 were passed.
155139
,--> input.scss
156-
2 | a {b: math.abs(1, 2)}
157-
| ^^^^^^^^^^^^^^ invocation
140+
1 | a {b: abs(1, 2)}
141+
| ^^^^^^^^^ invocation
158142
'
159143
,--> sass:math
160144
1 | @function abs($number) {
161145
| ============ declaration
162146
'
163-
input.scss 2:7 root stylesheet
147+
input.scss 1:7 root stylesheet
164148

165149
<===> error/too_many_args/error-libsass
166150
Error: wrong number of arguments (2 for 1) for `abs'
167151
on line 1:7 of input.scss
168-
>> a {b: math.abs(1, 2)}
152+
>> a {b: abs(1, 2)}
169153

170154
------^

spec/core_functions/math/round.hrx

Lines changed: 26 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,5 @@
1-
<===> options.yml
2-
---
3-
:ignore_for:
4-
- libsass
5-
6-
<===>
7-
================================================================================
81
<===> integer/input.scss
9-
@use "sass:math";
10-
a {b: math.round(1)}
2+
a {b: round(1)}
113

124
<===> integer/output.css
135
a {
@@ -17,8 +9,7 @@ a {
179
<===>
1810
================================================================================
1911
<===> up/high/input.scss
20-
@use "sass:math";
21-
a {b: math.round(2.9)}
12+
a {b: round(2.9)}
2213

2314
<===> up/high/output.css
2415
a {
@@ -28,8 +19,7 @@ a {
2819
<===>
2920
================================================================================
3021
<===> up/point_five/input.scss
31-
@use "sass:math";
32-
a {b: math.round(16.5)}
22+
a {b: round(16.5)}
3323

3424
<===> up/point_five/output.css
3525
a {
@@ -39,8 +29,7 @@ a {
3929
<===>
4030
================================================================================
4131
<===> up/negative/input.scss
42-
@use "sass:math";
43-
a {b: math.round(-5.4)}
32+
a {b: round(-5.4)}
4433

4534
<===> up/negative/output.css
4635
a {
@@ -50,8 +39,7 @@ a {
5039
<===>
5140
================================================================================
5241
<===> up/to_zero/input.scss
53-
@use "sass:math";
54-
a {b: math.round(-0.2)}
42+
a {b: round(-0.2)}
5543

5644
<===> up/to_zero/output.css
5745
a {
@@ -61,8 +49,7 @@ a {
6149
<===>
6250
================================================================================
6351
<===> down/low/input.scss
64-
@use "sass:math";
65-
a {b: math.round(2.2)}
52+
a {b: round(2.2)}
6653

6754
<===> down/low/output.css
6855
a {
@@ -72,8 +59,7 @@ a {
7259
<===>
7360
================================================================================
7461
<===> down/negative/input.scss
75-
@use "sass:math";
76-
a {b: math.round(-5.6)}
62+
a {b: round(-5.6)}
7763

7864
<===> down/negative/output.css
7965
a {
@@ -83,8 +69,7 @@ a {
8369
<===>
8470
================================================================================
8571
<===> down/to_zero/input.scss
86-
@use "sass:math";
87-
a {b: math.round(0.2)}
72+
a {b: round(0.2)}
8873

8974
<===> down/to_zero/output.css
9075
a {
@@ -100,8 +85,7 @@ a {
10085
<===> down/within_precision/input.scss
10186
// This is the largest number that's representable as a float and outside the
10287
// precision range to be considered equal to 1.5.
103-
@use "sass:math";
104-
a {b: math.round(1.4999999999949998)}
88+
a {b: round(1.4999999999949998)}
10589

10690
<===> down/within_precision/output.css
10791
a {
@@ -115,8 +99,7 @@ a {
11599
- sass/libsass#2887
116100

117101
<===> preserves_units/input.scss
118-
@use "sass:math";
119-
a {b: math.round(7px / 4em) * 1em}
102+
a {b: round(7px / 4em) * 1em}
120103

121104
<===> preserves_units/output.css
122105
a {
@@ -131,16 +114,15 @@ Recommendation: math.div(7px, 4em)
131114
More info and automated migrator: https://sass-lang.com/d/slash-div
132115

133116
,
134-
2 | a {b: math.round(7px / 4em) * 1em}
135-
| ^^^^^^^^^
117+
1 | a {b: round(7px / 4em) * 1em}
118+
| ^^^^^^^^^
136119
'
137-
input.scss 2:18 root stylesheet
120+
input.scss 1:13 root stylesheet
138121

139122
<===>
140123
================================================================================
141124
<===> named/input.scss
142-
@use "sass:math";
143-
a {b: math.round($number: 1.6)}
125+
a {b: round($number: 1.6)}
144126

145127
<===> named/output.css
146128
a {
@@ -150,16 +132,15 @@ a {
150132
<===>
151133
================================================================================
152134
<===> error/type/input.scss
153-
@use "sass:math";
154-
a {b: math.round(c)}
135+
a {b: round(c)}
155136

156137
<===> error/type/error
157138
Error: $number: c is not a number.
158139
,
159-
2 | a {b: math.round(c)}
160-
| ^^^^^^^^^^^^^
140+
1 | a {b: round(c)}
141+
| ^^^^^^^^
161142
'
162-
input.scss 2:7 root stylesheet
143+
input.scss 1:7 root stylesheet
163144

164145
<===> error/type/error-libsass
165146
Error: argument `$number` of `round($number)` must be a number
@@ -172,20 +153,19 @@ Error: argument `$number` of `round($number)` must be a number
172153
<===>
173154
================================================================================
174155
<===> error/too_few_args/input.scss
175-
@use "sass:math";
176-
a {b: math.round()}
156+
a {b: round()}
177157

178158
<===> error/too_few_args/error
179159
Error: Missing argument $number.
180160
,--> input.scss
181-
2 | a {b: math.round()}
182-
| ^^^^^^^^^^^^ invocation
161+
1 | a {b: round()}
162+
| ^^^^^^^ invocation
183163
'
184164
,--> sass:math
185165
1 | @function round($number) {
186166
| ============== declaration
187167
'
188-
input.scss 2:7 root stylesheet
168+
input.scss 1:7 root stylesheet
189169

190170
<===> error/too_few_args/error-libsass
191171
Error: Function round is missing argument $number.
@@ -197,21 +177,20 @@ Error: Function round is missing argument $number.
197177
<===>
198178
================================================================================
199179
<===> error/too_many_args/input.scss
200-
@use "sass:math";
201-
a {b: math.round(1, 2)}
180+
a {b: round(1, 2)}
202181

203182

204183
<===> error/too_many_args/error
205184
Error: Only 1 argument allowed, but 2 were passed.
206185
,--> input.scss
207-
2 | a {b: math.round(1, 2)}
208-
| ^^^^^^^^^^^^^^^^ invocation
186+
1 | a {b: round(1, 2)}
187+
| ^^^^^^^^^^^ invocation
209188
'
210189
,--> sass:math
211190
1 | @function round($number) {
212191
| ============== declaration
213192
'
214-
input.scss 2:7 root stylesheet
193+
input.scss 1:7 root stylesheet
215194

216195
<===> error/too_many_args/error-libsass
217196
Error: wrong number of arguments (2 for 1) for `round'

0 commit comments

Comments
 (0)