Skip to content

Commit 72fe409

Browse files
committed
some tests for *ⁿ
1 parent 4d14891 commit 72fe409

File tree

1 file changed

+26
-1
lines changed

1 file changed

+26
-1
lines changed

S32-num/power.t

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ use lib 't/spec/packages';
33
use Test;
44
use Test::Util;
55

6-
plan 78;
6+
plan 97;
77

88
# Real **
99
is(0 ** 0, 1, "0 ** 0 == 1");
@@ -103,6 +103,31 @@ is(2³², 2 ** 32, "2³² == 2 ** 32");
103103
is(2⁶⁴, 2 ** 64, "2⁶⁴ == 2 ** 64");
104104
is(10¹⁰⁰, 10 ** 100, "10¹⁰⁰ == 10 ** 100");
105105

106+
# Test corresponding curried forms
107+
108+
is(*⁰(0), 1, "*⁰(0) == 1");
109+
is(*¹(0), 0, "*¹(0) == 0");
110+
is(*²(1), 1, "*²(1) == 1");
111+
is(*⁰(4), 1, "*⁰() == 1");
112+
is(*¹(4), 4, "*¹() == 4");
113+
is(*²(4), 16, "*²() == 16");
114+
is(*³²(2), 2 ** 32, "*³²(2) == 2 ** 32");
115+
is(*⁶⁴(2), 2 ** 64, "*⁶⁴(2) == 2 ** 64");
116+
is(*¹⁰⁰(10), 10 ** 100, "*¹⁰⁰(10) == 10 ** 100");
117+
118+
# Test some odd numbers too.
119+
120+
is(3³, *³(3), "");
121+
is(3⁴, *⁴(3), "3⁴");
122+
is(3⁵, *⁵(3), "3⁵");
123+
is(3⁶, *⁶(3), "3⁶");
124+
is(3⁷, *⁷(3), "3⁷");
125+
is(3⁸, *⁸(3), "3⁸");
126+
is(3⁹, *⁹(3), "3⁹");
127+
is(3¹⁰, *¹⁰(3), "3¹⁰");
128+
is(3¹³, *¹³(3), "3¹³");
129+
is((-1)¹²³, *¹²³(-1), "(-1)¹²³");
130+
106131
is 0⁴⁵⁵³⁵³⁵³⁴⁵³⁶⁴⁵³⁵³⁴⁵, 0, "0⁴⁵⁵³⁵³⁵³⁴⁵³⁶⁴⁵³⁵³⁴⁵ == 0";
107132
is 1⁴⁵⁵³⁵³⁵³⁴⁵³⁶⁴⁵³⁵³⁴⁵, 1, "1⁴⁵⁵³⁵³⁵³⁴⁵³⁶⁴⁵³⁵³⁴⁵ == 1";
108133
is 1e0⁴⁵⁵³⁵³⁵³⁴⁵³⁶⁴⁵³⁵³⁴⁵, 1, "1e0⁴⁵⁵³⁵³⁵³⁴⁵³⁶⁴⁵³⁵³⁴⁵ == 1";

0 commit comments

Comments
 (0)