Skip to content

Commit d7e7eaf

Browse files
authored
Add tests for calculation constants (#1890)
Closes #1885 See sass/sass#3258
1 parent 778aefa commit d7e7eaf

23 files changed

+669
-96
lines changed

spec/core_functions/math/acos.hrx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ a {b: math.acos(-2)}
1111

1212
<===> less_than_negative_one/output.css
1313
a {
14-
b: NaNdeg;
14+
b: calc(NaN * 1deg);
1515
}
1616

1717
<===>
@@ -55,7 +55,7 @@ a {b: math.acos(1.000000000001)}
5555

5656
<===> one_fuzzy/output.css
5757
a {
58-
b: NaNdeg;
58+
b: calc(NaN * 1deg);
5959
}
6060

6161
<===>
@@ -66,7 +66,7 @@ a {b: math.acos(2)}
6666

6767
<===> greater_than_one/output.css
6868
a {
69-
b: NaNdeg;
69+
b: calc(NaN * 1deg);
7070
}
7171

7272
<===>

spec/core_functions/math/asin.hrx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ a {b: math.asin(-2)}
1111

1212
<===> less_than_negative_one/output.css
1313
a {
14-
b: NaNdeg;
14+
b: calc(NaN * 1deg);
1515
}
1616

1717
<===>
@@ -99,7 +99,7 @@ a {b: math.asin(1.000000000001)}
9999

100100
<===> one_fuzzy/output.css
101101
a {
102-
b: NaNdeg;
102+
b: calc(NaN * 1deg);
103103
}
104104

105105
<===>
@@ -110,7 +110,7 @@ a {b: math.asin(2)}
110110

111111
<===> greater_than_one/output.css
112112
a {
113-
b: NaNdeg;
113+
b: calc(NaN * 1deg);
114114
}
115115

116116
<===>

spec/core_functions/math/cos.hrx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ a {b: math.cos(math.div(-1, 0))}
1111

1212
<===> negative_infinity/output.css
1313
a {
14-
b: NaN;
14+
b: calc(NaN);
1515
}
1616

1717
<===>
@@ -22,7 +22,7 @@ a {b: math.cos(math.div(1, 0))}
2222

2323
<===> infinity/output.css
2424
a {
25-
b: NaN;
25+
b: calc(NaN);
2626
}
2727

2828
<===>

spec/core_functions/math/hypot.hrx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ a {b: math.hypot(math.div(1, 0), 1, 1)}
3333

3434
<===> infinity/first/output.css
3535
a {
36-
b: Infinity;
36+
b: calc(infinity);
3737
}
3838

3939
<===>
@@ -44,7 +44,7 @@ a {b: math.hypot(1, math.div(1, 0), 1)}
4444

4545
<===> infinity/second/output.css
4646
a {
47-
b: Infinity;
47+
b: calc(infinity);
4848
}
4949

5050
<===>
@@ -55,7 +55,7 @@ a {b: math.hypot(1, 1, math.div(1, 0))}
5555

5656
<===> infinity/third/output.css
5757
a {
58-
b: Infinity;
58+
b: calc(infinity);
5959
}
6060

6161
<===>

spec/core_functions/math/log.hrx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ a {b: math.log(-1)}
1111

1212
<===> negative/output.css
1313
a {
14-
b: NaN;
14+
b: calc(NaN);
1515
}
1616

1717
<===>
@@ -22,7 +22,7 @@ a {b: math.log(0)}
2222

2323
<===> zero/output.css
2424
a {
25-
b: -Infinity;
25+
b: calc(-infinity);
2626
}
2727

2828
<===>
@@ -55,7 +55,7 @@ a {b: math.log(math.div(1, 0))}
5555

5656
<===> infinity/output.css
5757
a {
58-
b: Infinity;
58+
b: calc(infinity);
5959
}
6060

6161
<===>
@@ -77,7 +77,7 @@ a {b: math.log(2, -1)}
7777

7878
<===> base/negative/output.css
7979
a {
80-
b: NaN;
80+
b: calc(NaN);
8181
}
8282

8383
<===>
@@ -121,7 +121,7 @@ a {b: math.log(2, 1)}
121121

122122
<===> base/one/output.css
123123
a {
124-
b: Infinity;
124+
b: calc(infinity);
125125
}
126126

127127
<===>

spec/core_functions/math/pow/base_greater_than_zero.hrx

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ a {b: math.pow(0.5, math.div(-1, 0))}
44

55
<===> base/less_than_one/with_exponent/negative_infinity/output.css
66
a {
7-
b: Infinity;
7+
b: calc(infinity);
88
}
99

1010
<===>
@@ -59,7 +59,7 @@ a {b: math.pow(1.000000000001, math.div(1, 0))}
5959

6060
<===> base/one_fuzzy/with_exponent/infinity/output.css
6161
a {
62-
b: Infinity;
62+
b: calc(infinity);
6363
}
6464

6565
<===>
@@ -136,6 +136,5 @@ a {b: math.pow(2, math.div(1, 0))}
136136

137137
<===> base/greater_than_one/with_exponent/infinity/output.css
138138
a {
139-
b: Infinity;
139+
b: calc(infinity);
140140
}
141-

spec/core_functions/math/pow/base_less_than_zero.hrx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ a {b: math.pow(-0.5, math.div(-1, 0))}
44

55
<===> base/greater_than_negative_one/with_exponent/negative_infinity/output.css
66
a {
7-
b: Infinity;
7+
b: calc(infinity);
88
}
99

1010
<===>
@@ -59,7 +59,7 @@ a {b: math.pow(-1.000000000001, math.div(1, 0))}
5959

6060
<===> base/negative_one_fuzzy/with_exponent/infinity/output.css
6161
a {
62-
b: Infinity;
62+
b: calc(infinity);
6363
}
6464

6565
<===>
@@ -92,7 +92,7 @@ a {b: math.pow(-2, 0.000000000001)}
9292

9393
<===> base/less_than_negative_one/with_exponent/zero_fuzzy/output.css
9494
a {
95-
b: NaN;
95+
b: calc(NaN);
9696
}
9797

9898
<===>
@@ -114,7 +114,7 @@ a {b: math.pow(-2, 2.000000000001)}
114114

115115
<===> base/less_than_negative_one/with_exponent/integer_fuzzy/output.css
116116
a {
117-
b: NaN;
117+
b: calc(NaN);
118118
}
119119

120120
<===>
@@ -125,7 +125,7 @@ a {b: math.pow(-2, 0.5)}
125125

126126
<===> base/less_than_negative_one/with_exponent/decimal/output.css
127127
a {
128-
b: NaN;
128+
b: calc(NaN);
129129
}
130130

131131
<===>
@@ -136,5 +136,5 @@ a {b: math.pow(-2, math.div(1, 0))}
136136

137137
<===> base/less_than_negative_one/with_exponent/infinity/output.css
138138
a {
139-
b: Infinity;
139+
b: calc(infinity);
140140
}

spec/core_functions/math/pow/base_negative_infinity.hrx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ a {b: math.pow(math.div(-1, 0), 0.000000000001)}
8181

8282
<===> with_exponent/zero_fuzzy/output.css
8383
a {
84-
b: Infinity;
84+
b: calc(infinity);
8585
}
8686

8787
<===>
@@ -92,7 +92,7 @@ a {b: math.pow(math.div(-1, 0), 2)}
9292

9393
<===> with_exponent/even_integer/output.css
9494
a {
95-
b: Infinity;
95+
b: calc(infinity);
9696
}
9797

9898
<===>
@@ -103,7 +103,7 @@ a {b: math.pow(math.div(-1, 0), 2.000000000001)}
103103

104104
<===> with_exponent/even_integer_fuzzy/output.css
105105
a {
106-
b: Infinity;
106+
b: calc(infinity);
107107
}
108108

109109
<===>
@@ -114,7 +114,7 @@ a {b: math.pow(math.div(-1, 0), 3)}
114114

115115
<===> with_exponent/odd_integer/output.css
116116
a {
117-
b: -Infinity;
117+
b: calc(-infinity);
118118
}
119119

120120
<===>
@@ -125,7 +125,7 @@ a {b: math.pow(math.div(-1, 0), 3.000000000001)}
125125

126126
<===> with_exponent/odd_integer_fuzzy/output.css
127127
a {
128-
b: Infinity;
128+
b: calc(infinity);
129129
}
130130

131131
<===>
@@ -136,7 +136,7 @@ a {b: math.pow(math.div(-1, 0), 2.5)}
136136

137137
<===> with_exponent/decimal/output.css
138138
a {
139-
b: Infinity;
139+
b: calc(infinity);
140140
}
141141

142142
<===>
@@ -147,5 +147,5 @@ a {b: math.pow(math.div(-1, 0), math.div(1, 0))}
147147

148148
<===> with_exponent/infinity/output.css
149149
a {
150-
b: Infinity;
150+
b: calc(infinity);
151151
}

spec/core_functions/math/pow/base_negative_zero.hrx

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ a {b: math.pow(-0.0, math.div(-1, 0))}
44

55
<===> with_exponent/negative_infinity/output.css
66
a {
7-
b: Infinity;
7+
b: calc(infinity);
88
}
99

1010
<===>
@@ -15,7 +15,7 @@ a {b: math.pow(-0.0, -2)}
1515

1616
<===> with_exponent/negative_even_integer/output.css
1717
a {
18-
b: Infinity;
18+
b: calc(infinity);
1919
}
2020

2121
<===>
@@ -26,7 +26,7 @@ a {b: math.pow(-0.0, -2.000000000001)}
2626

2727
<===> with_exponent/negative_even_integer_fuzzy/output.css
2828
a {
29-
b: Infinity;
29+
b: calc(infinity);
3030
}
3131

3232
<===>
@@ -37,7 +37,7 @@ a {b: math.pow(-0.0, -3)}
3737

3838
<===> with_exponent/negative_odd_integer/output.css
3939
a {
40-
b: -Infinity;
40+
b: calc(-infinity);
4141
}
4242

4343
<===>
@@ -48,7 +48,7 @@ a {b: math.pow(-0.0, -3.000000000001)}
4848

4949
<===> with_exponent/negative_odd_integer_fuzzy/output.css
5050
a {
51-
b: Infinity;
51+
b: calc(infinity);
5252
}
5353

5454
<===>
@@ -59,7 +59,7 @@ a {b: math.pow(-0.0, -0.5)}
5959

6060
<===> with_exponent/negative_decimal/output.css
6161
a {
62-
b: Infinity;
62+
b: calc(infinity);
6363
}
6464

6565
<===>
@@ -158,7 +158,7 @@ a {b: math.pow(-0.000000000001, math.div(-1, 0))}
158158

159159
<===> fuzzy/with_exponent/negative_infinity/output.css
160160
a {
161-
b: Infinity;
161+
b: calc(infinity);
162162
}
163163

164164
<===>
@@ -191,7 +191,7 @@ a {b: math.pow(-0.000000000001, -0.5)}
191191

192192
<===> fuzzy/with_exponent/negative_decimal/output.css
193193
a {
194-
b: NaN;
194+
b: calc(NaN);
195195
}
196196

197197
<===>
@@ -235,7 +235,7 @@ a {b: math.pow(-0.000000000001, 0.5)}
235235

236236
<===> fuzzy/with_exponent/decimal/output.css
237237
a {
238-
b: NaN;
238+
b: calc(NaN);
239239
}
240240

241241
<===>

0 commit comments

Comments
 (0)