|
1 | 1 | use v6;
|
2 | 2 | use Test;
|
3 | 3 |
|
4 |
| -plan 132; |
| 4 | +plan 144; |
5 | 5 |
|
6 | 6 | ## N.B.: Tests for infix:Β«<=>Β» (spaceship) and infix:<cmp> belong
|
7 | 7 | ## in F<t/S03-operators/comparison.t>.
|
@@ -183,13 +183,30 @@ ok exp(i * pi) =~= -1, "=~= does approximate equality";
|
183 | 183 | ok exp(i * pi) β
-1, "β
does approximate equality";
|
184 | 184 |
|
185 | 185 | {
|
186 |
| - my $*SIGNIFICANCE = 0.1; |
187 |
| - ok 1.01 =~= 1, '=~= pays attention to $*SIGNIFICANCE (More)'; |
188 |
| - ok 0.99 =~= 1, '=~= pays attention to $*SIGNIFICANCE (Less)'; |
189 |
| - ok 1.01 β
1, 'β
pays attention to $*SIGNIFICANCE (More)'; |
190 |
| - ok 0.99 β
1, 'β
pays attention to $*SIGNIFICANCE (Less)'; |
191 |
| - nok 1.2 β
1, 'β
pays attention to $*SIGNIFICANCE (more More)'; |
192 |
| - nok 0.8 β
1, 'β
pays attention to $*SIGNIFICANCE (more Less)'; |
| 186 | + my $*TOLERANCE = 0.1; |
| 187 | + ok 1.01 =~= 1, '=~= pays attention to $*TOLERANCE (More)'; |
| 188 | + ok 0.99 =~= 1, '=~= pays attention to $*TOLERANCE (Less)'; |
| 189 | + ok 1.01 β
1, 'β
pays attention to $*TOLERANCE (More)'; |
| 190 | + ok 0.99 β
1, 'β
pays attention to $*TOLERANCE (Less)'; |
| 191 | + nok 1.2 β
1, 'β
pays attention to $*TOLERANCE (more More)'; |
| 192 | + nok 0.8 β
1, 'β
pays attention to $*TOLERANCE (more Less)'; |
| 193 | +
|
| 194 | + # β
is scaled up to larger arg |
| 195 | + ok 101 =~= 100, '=~= pays attention to scaled-up $*TOLERANCE (More)'; |
| 196 | + ok 99 =~= 100, '=~= pays attention to scaled-up $*TOLERANCE (Less)'; |
| 197 | + ok 101 β
100, 'β
pays attention to scaled-up $*TOLERANCE (More)'; |
| 198 | + ok 99 β
100, 'β
pays attention to scaled-up $*TOLERANCE (Less)'; |
| 199 | + nok 120 β
100, 'β
pays attention to scaled-up $*TOLERANCE (more More)'; |
| 200 | + nok 80 β
100, 'β
pays attention to scaled-up $*TOLERANCE (more Less)'; |
| 201 | +
|
| 202 | + # β
is scaled down to larger arg |
| 203 | + ok 0.00101 =~= .001, '=~= pays attention to scaled-down $*TOLERANCE (More)'; |
| 204 | + ok 0.00099 =~= .001, '=~= pays attention to scaled-down $*TOLERANCE (Less)'; |
| 205 | + ok 0.00101 β
.001, 'β
pays attention to scaled-down $*TOLERANCE (More)'; |
| 206 | + ok 0.00099 β
.001, 'β
pays attention to scaled-down $*TOLERANCE (Less)'; |
| 207 | + nok 0.00120 β
.001, 'β
pays attention to scaled-down $*TOLERANCE (more More)'; |
| 208 | + nok 0.00080 β
.001, 'β
pays attention to scaled-down $*TOLERANCE (more Less)'; |
| 209 | +
|
193 | 210 | }
|
194 | 211 |
|
195 | 212 | # vim: ft=perl6
|
0 commit comments