Skip to content

Commit 239f25d

Browse files
committed
add tests for #131122
handling of large values in unsigned integer attributes
1 parent 4c360a3 commit 239f25d

File tree

1 file changed

+22
-1
lines changed

1 file changed

+22
-1
lines changed

S12-attributes/native.t

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ use v6;
22

33
use Test;
44

5-
plan 45;
5+
plan 48;
66

77
class C {
88
has int $.int-ro = 1;
@@ -121,3 +121,24 @@ class MV {
121121
}
122122
is MV.new(start => 42).start, 42, 'uint64 native attribute accessor works';
123123
is MV.new(start => 4).s, 5, 'uint64 native attribute use in method works';
124+
125+
# RT #131122
126+
{
127+
my class C1 {
128+
has uint8 $.ff;
129+
}
130+
my $c = C1.new(ff => 255);
131+
#?rakudo todo 'RT #131122'
132+
is $c.ff, 255, 'large unsigned ints';
133+
134+
my class C2 is repr('CStruct') {
135+
has uint8 $.ff is rw;
136+
}
137+
138+
my $c2 = C2.new;
139+
$c2.ff = 100;
140+
is $c2.ff, 100, 'unsigned int sanity';
141+
$c2.ff = 200;
142+
#?rakudo todo 'RT #131122'
143+
is $c2.ff, 200, 'large unsigned ints';
144+
}

0 commit comments

Comments
 (0)