Skip to content

Commit 46221b1

Browse files
committed
fix some of the bigint tests
1 parent cbd6c19 commit 46221b1

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

t/nqp/60-bigint.t

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,21 +7,19 @@ my $knowhow := pir::get_knowhow__P();
77
my $bi_type := $knowhow.HOW.new_type(:name('TestBigInt'), :repr('P6bigint'));
88
$bi_type.HOW.compose($bi_type);
99
sub s($x) { pir::nqp_bigint_to_str__SP($x) };
10+
sub iseq($x, $y) { nqp::iseq_I($x, nqp::box_i($y, $bi_type)) }
1011

1112
my $one := nqp::box_i(1, $bi_type);
1213

1314
my $b := pir::nqp_bigint_from_str__PPS($one, '-123');
1415
my $c := nqp::box_i(-123, $bi_type);
15-
say(s($c));
16-
say(s(nqp::box_i(2, $bi_type)));
17-
say(nqp::unbox_i($c));
1816

1917
ok(s($b) eq '-123', 'can round-trip negative number (string)');
2018
ok(s($c) eq '-123', 'can round-trip negative number (string) by boxing');
2119
ok(nqp::unbox_i($b) == -123, 'can round-trip negative number by unboxing');
2220
ok(!nqp::iseq_I($one, $b), 'nqp::iseq_I can return false');
2321
ok(nqp::iseq_I($one, $one), 'nqp::iseq_I can return true');
24-
ok(nqp::iseq_I(nqp::mul_I($b, $b), 15129,), 'multiplication');
25-
ok(nqp::iseq_I(nqp::add_I($b, $b), -246,), 'addition');
22+
ok(iseq(nqp::mul_I($b, $b), 15129,), 'multiplication');
23+
ok(iseq(nqp::add_I($b, $b), -246,), 'addition');
2624
ok(nqp::iseq_I(nqp::sub_I($b, $b), nqp::box_i(0, $bi_type)), 'subtraction');
2725
ok(nqp::iseq_I(nqp::div_I($b, $b), $one), 'division');

0 commit comments

Comments
 (0)