@@ -3,7 +3,7 @@ use lib 't/spec/packages';
3
3
use Test ;
4
4
use Test ::Util;
5
5
6
- plan 99 ;
6
+ plan 97 ;
7
7
8
8
# Real **
9
9
is (0 ** 0 , 1 , " 0 ** 0 == 1" );
@@ -13,19 +13,16 @@ is(4 ** 0, 1, "4 ** 0 == 1");
13
13
is (4 ** 1 , 4 , " 4 ** 1 == 4" );
14
14
is (4 ** 2 , 16 , " 4 ** 2 == 16" );
15
15
16
- my $ big-e = 4553535345364535345634543534 ;
17
- my $ big-o = 4553535345364535345634543533 ;
18
- my $ xno = X::Numeric::Overflow ;
19
-
20
- is 0 ** $ big-e , 0 , " 0 ** $ big-e == 0" ;
21
- is 1 ** $ big-e , 1 , " 1 ** $ big-e == 1" ;
22
- is 1e0 ** $ big-e , 1 , " 1e0 ** $ big-e == 1" ;
23
- isa-ok 1e0 ** $ big-e , Num , " 1e0 ** $ big-e is a Num" ;
24
- is (-1 ) ** $ big-e , 1 , " -1 ** $ big-e == 1" ;
25
- is (-1 ) ** $ big-o , -1 , " -1 ** $ big-o == -1" ;
26
- throws-like { EVAL qq [ 2 ** $ big-e ] }, $ xno , " 2 ** $ big-e" ;
27
- throws-like { EVAL qq [ (-2) ** $ big-e ] }, $ xno , " -2 ** $ big-e" ;
28
- throws-like { EVAL qq [ (-2) ** $ big-o ] }, $ xno , " -2 ** $ big-o" ;
16
+ my $ large-even = 4553535345364535345634543534 ;
17
+ my $ large-odd = 4553535345364535345634543533 ;
18
+ is-deeply 0 ** $ large-even , 0 , " 0 ** $ large-even == 0" ;
19
+ is-deeply 1 ** $ large-even , 1 , " 1 ** $ large-even == 1" ;
20
+ is-deeply 1e0 ** $ large-even , 1e0 , " 1e0 ** $ large-even == 1" ;
21
+ is-deeply (-1 ) ** $ large-even , 1 , " -1 ** $ large-even == 1" ;
22
+ is-deeply (-1 ) ** $ large-odd , -1 , " -1 ** $ large-odd == -1" ;
23
+ throws-like " 2 ** $ large-even" , X::Numeric::Overflow , " 2 ** $ large-even" ;
24
+ throws-like " (-2) ** $ large-even" , X::Numeric::Overflow , " -2 ** $ large-even" ;
25
+ throws-like " (-2) ** $ large-odd" , X::Numeric::Overflow , " -2 ** $ large-odd" ;
29
26
30
27
is (4 ** 0.5 , 2 , " 4 ** .5 == 2" );
31
28
is (4 ** (1 / 2 ), 2 , " 4 ** (1/2) == 2 " );
@@ -126,15 +123,17 @@ is(3¹⁰, *¹⁰(3), "3¹⁰");
126
123
is (3 ¹³, * ¹³(3 ), " 3¹³" );
127
124
is ((-1 )¹²³, * ¹²³(-1 ), " (-1)¹²³" );
128
125
129
- is 0 ⁴⁵⁵³⁵³⁵³⁴⁵³⁶⁴⁵³⁵³⁴⁵, 0 , " 0⁴⁵⁵³⁵³⁵³⁴⁵³⁶⁴⁵³⁵³⁴⁵ == 0" ;
130
- is 1 ⁴⁵⁵³⁵³⁵³⁴⁵³⁶⁴⁵³⁵³⁴⁵, 1 , " 1⁴⁵⁵³⁵³⁵³⁴⁵³⁶⁴⁵³⁵³⁴⁵ == 1" ;
131
- is 1e0 ⁴⁵⁵³⁵³⁵³⁴⁵³⁶⁴⁵³⁵³⁴⁵, 1 , " 1e0⁴⁵⁵³⁵³⁵³⁴⁵³⁶⁴⁵³⁵³⁴⁵ == 1" ;
132
- isa-ok 1e0 ⁴⁵⁵³⁵³⁵³⁴⁵³⁶⁴⁵³⁵³⁴⁵, Num , " 1e0⁴⁵⁵³⁵³⁵³⁴⁵³⁶⁴⁵³⁵³⁴⁵ is a Num" ;
133
- is (-1 )⁴⁵⁵³⁵³⁵³⁴⁵³⁶⁴⁵³⁵³⁵⁴, 1 , " (-1)⁴⁵⁵³⁵³⁵³⁴⁵³⁶⁴⁵³⁵³⁵⁴ == 1" ;
134
- is (-1 )⁴⁵⁵³⁵³⁵³⁴⁵³⁶⁴⁵³⁵³⁴⁵, -1 , " (-1)⁴⁵⁵³⁵³⁵³⁴⁵³⁶⁴⁵³⁵³⁴⁵ == -1" ;
135
- throws-like { EVAL qq [ 2⁴⁵⁵³⁵³⁵³⁴⁵³⁶⁴⁵³⁵³⁴⁵ ] }, $ xno , " 2⁴⁵⁵³⁵³⁵³⁴⁵³⁶⁴⁵³⁵³⁴⁵ throws" ;
136
- throws-like { EVAL qq [ (-2)⁴⁵⁵³⁵³⁵³⁴⁵³⁶⁴⁵³⁵³⁵⁴ ] }, $ xno , " (-2)⁴⁵⁵³⁵³⁵³⁴⁵³⁶⁴⁵³⁵³⁵⁴ throws" ;
137
- throws-like { EVAL qq [ (-2)⁴⁵⁵³⁵³⁵³⁴⁵³⁶⁴⁵³⁵³⁴⁵ ] }, $ xno , " (-2)⁴⁵⁵³⁵³⁵³⁴⁵³⁶⁴⁵³⁵³⁴⁵ throws" ;
126
+ is-deeply 0 ⁴⁵⁵³⁵³⁵³⁴⁵³⁶⁴⁵³⁵³⁴⁵, 0 , " 0⁴⁵⁵³⁵³⁵³⁴⁵³⁶⁴⁵³⁵³⁴⁵ == 0" ;
127
+ is-deeply 1 ⁴⁵⁵³⁵³⁵³⁴⁵³⁶⁴⁵³⁵³⁴⁵, 1 , " 1⁴⁵⁵³⁵³⁵³⁴⁵³⁶⁴⁵³⁵³⁴⁵ == 1" ;
128
+ is-deeply 1e0 ⁴⁵⁵³⁵³⁵³⁴⁵³⁶⁴⁵³⁵³⁴⁵, 1e0 , " 1e0⁴⁵⁵³⁵³⁵³⁴⁵³⁶⁴⁵³⁵³⁴⁵ == 1" ;
129
+ is-deeply (-1 )⁴⁵⁵³⁵³⁵³⁴⁵³⁶⁴⁵³⁵³⁵⁴, 1 , " (-1)⁴⁵⁵³⁵³⁵³⁴⁵³⁶⁴⁵³⁵³⁵⁴ == 1" ;
130
+ is-deeply (-1 )⁴⁵⁵³⁵³⁵³⁴⁵³⁶⁴⁵³⁵³⁴⁵, -1 , " (-1)⁴⁵⁵³⁵³⁵³⁴⁵³⁶⁴⁵³⁵³⁴⁵ == -1" ;
131
+ throws-like ' 2⁴⁵⁵³⁵³⁵³⁴⁵³⁶⁴⁵³⁵³⁴⁵' , X::Numeric::Overflow ,
132
+ ' 2⁴⁵⁵³⁵³⁵³⁴⁵³⁶⁴⁵³⁵³⁴⁵ throws' ;
133
+ throws-like ' (-2)⁴⁵⁵³⁵³⁵³⁴⁵³⁶⁴⁵³⁵³⁵⁴' , X::Numeric::Overflow ,
134
+ ' (-2)⁴⁵⁵³⁵³⁵³⁴⁵³⁶⁴⁵³⁵³⁵⁴ throws' ;
135
+ throws-like ' (-2)⁴⁵⁵³⁵³⁵³⁴⁵³⁶⁴⁵³⁵³⁴⁵' , X::Numeric::Overflow ,
136
+ ' (-2)⁴⁵⁵³⁵³⁵³⁴⁵³⁶⁴⁵³⁵³⁴⁵ throws' ;
138
137
139
138
# ?rakudo.jvm 6 skip 'parsing issue on JVM: Missing required term after infix'
140
139
is (4 ** ½, 2 , " 4 ** ½ == 2" );
@@ -151,8 +150,9 @@ is-approx(27 ** -⅔, ⅑, "27 ** -⅔ == ⅑");
151
150
is_run 「 start { sleep 2; say ‘pass’; exit }; EVAL ‘say 1.0000001 ** (10 ** 8)’」 ,
152
151
{: out(" pass\n " ), : err(' ' ), : 0 status },
153
152
' raising a Rat to largish power does not throw' ;
154
- throws-like { EVAL qq [ say 1.0000001 ** (10 ** 90000) ] },
155
- $ xno , " raising a Rat to a very large number throws" ;
153
+
154
+ throws-like ' say 1.0000001 ** (10 ** 90000)' ,
155
+ X::Numeric::Overflow , " raising a Rat to a very large number throws" ;
156
156
157
157
# RT#126732
158
158
# ?rakudo.jvm skip 'unival NYI'
0 commit comments