Skip to content

Commit 4aa561b

Browse files
committed
Test passing numbers with a unparsed suffix to nqp::radix*
1 parent d586ebd commit 4aa561b

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

t/nqp/081-radix.t

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
plan(26*3*2 + 3);
1+
plan(31*3*2 + 3);
22

33
sub test_radix($radix,$str,$pos,$flags,$value,$mult,$offset,$desc) {
44
my $result := nqp::radix($radix,$str,$pos,$flags);
@@ -69,3 +69,10 @@ if nqp::getcomp('nqp').backend.name eq 'jvm' {
6969
test_radix_both(16,$full_width_capital,0,2, 51966,65536,4, "fullwidth capital letters");
7070
test_radix_both(16,$full_width_small,0,2, 51966,65536,4, "fullwidth small letters");
7171
}
72+
73+
test_radix_both(8,"8238321",0,2, 0,1,-1, "all digits outside of radix");
74+
test_radix_both(8,"1838321",0,2, 1,8,1, "all but one digits outside of radix");
75+
76+
test_radix_both(10,"123foobar",0,2, 123,1000,3, "no digits consumed with digit outside radix");
77+
test_radix_both(8,"1238321",0,2, 83,512,3, "no digits consumed with digit outside radix");
78+
test_radix_both(8,"-1238321",1,2, 83,512,4, "no digits consumed with digit outside radix");

0 commit comments

Comments
 (0)