Skip to content

Commit c384d77

Browse files
committed
A few simple tests for bitops with bigints.
1 parent ecd7e35 commit c384d77

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

S03-operators/bit.t

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ use Test;
44

55
# Mostly copied from Perl 5.8.4 s t/op/bop.t
66

7-
plan 27;
7+
plan 30;
88

99
# test the bit operators '&', '|', '^', '+<', and '+>'
1010

@@ -18,7 +18,17 @@ plan 27;
1818
is( 0xdead +| 0xbeef, 0xfeef, 'numeric bitwise +| of hexadecimal' );
1919
is( 0xdead +^ 0xbeef, 0x6042, 'numeric bitwise +^ of hexadecimal' );
2020
is( +^0xdead +& 0xbeef, 0x2042, 'numeric bitwise +^ and +& together' );
21-
21+
22+
is 0xdeaddead0000deaddead0000dead +& 0xbeef0000beef0000beef0000beef,
23+
0x9ead0000000000009ead00009ead,
24+
'numeric bitwise +& of bigint';
25+
is 0xdeaddead0000deaddead0000dead +| 0xbeef0000beef0000beef0000beef,
26+
0xfeefdeadbeefdeadfeef0000feef,
27+
'numeric bitwise +| of bigint';
28+
is 0xdeaddead0000deaddead0000dead +^ 0xbeef0000beef0000beef0000beef,
29+
0x6042deadbeefdead604200006042,
30+
'numeric bitwise +^ of bigint';
31+
2232
# string
2333
#?niecza 6 skip 'string bitops'
2434
is( 'a' ~& 'A', 'A', 'string bitwise ~& of "a" and "A"' );

0 commit comments

Comments
 (0)