Skip to content

Commit 4a5edf7

Browse files
committed
Unfudge and adjust tests for array shapes RT #124502
1 parent 37a7757 commit 4a5edf7

File tree

1 file changed

+35
-34
lines changed

1 file changed

+35
-34
lines changed

S02-types/array-shapes.t

Lines changed: 35 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use v6;
22
use Test;
3-
plan 25;
3+
plan 26;
44

55
# L<S09/Fixed-size arrays>
66

@@ -11,26 +11,26 @@ plan 25;
1111
is(+@arr, 43, 'my @arr[*] autoextends like my @arr');
1212
}
1313

14-
#?rakudo skip 'array shapes NYI RT #124502'
1514
{
1615
my @arr[7] = <a b c d e f g>;
1716
is(@arr, [<a b c d e f g>], 'my @arr[num] can hold num things');
18-
throws-like {push @arr, 'h'},
19-
Exception, # XXX fix when this block is no longer skipped
17+
throws-like q[push @arr, 'h'],
18+
X::IllegalOnFixedDimensionArray,
19+
operation => 'push',
2020
'adding past num items in my @arr[num] dies';
21-
throws-like {@arr[7]},
22-
Exception, # XXX fix when this block is no longer skipped
21+
throws-like '@arr[7]',
22+
Exception,
2323
'accessing past num items in my @arr[num] dies';
2424
}
2525

26-
#?rakudo skip 'array shapes NYI RT #124502'
2726
{
28-
lives-ok { my @arr\ [7]},
29-
'array with fixed size with unspace');
30-
throws-like { EVAL 'my @arr.[8]' },
27+
lives-ok { my @arr\ [7] },
28+
'array with fixed size with unspace';
29+
#?rakudo 2 todo 'code does not die, array shapes RT #124502'
30+
throws-like 'my @arr.[8]',
3131
Exception, # XXX fix when this block is no longer skipped
3232
'array with dot form dies';
33-
throws-like { EVAL 'my @arr\ .[8]' },
33+
throws-like 'my @arr\ .[8]',
3434
Exception, # XXX fix when this block is no longer skipped
3535
'array with dot form and unspace dies';
3636
}
@@ -39,38 +39,38 @@ plan 25;
3939
{
4040
my @arr of Int = 1, 2, 3, 4, 5;
4141
is(@arr, <1 2 3 4 5>, 'my @arr of Type works');
42-
throws-like {push @arr, 's'},
42+
throws-like q[push @arr, 's'],
4343
X::TypeCheck,
4444
'type constraints on my @arr of Type works (1)';
45-
throws-like {push @arr, 4.2},
45+
throws-like 'push @arr, 4.2',
4646
X::TypeCheck,
4747
'type constraints on my @arr of Type works (2)';
4848
}
4949
{
5050
my Int @arr = 1, 2, 3, 4, 5;
5151
is(@arr, <1 2 3 4 5>, 'my Type @arr works');
52-
throws-like {push @arr, 's'},
52+
throws-like q[push @arr, 's'],
5353
X::TypeCheck,
5454
'type constraints on my Type @arr works (1)';
55-
throws-like {push @arr, 4.2},
55+
throws-like 'push @arr, 4.2',
5656
X::TypeCheck,
5757
'type constraints on my Type @arr works (2)';
5858
}
5959

60-
#?rakudo skip 'array shapes NYI RT #124502'
6160
{
6261
my @arr[5] of Int = <1 2 3 4 5>;
6362
is(@arr, <1 2 3 4 5>, 'my @arr[num] of Type works');
6463

65-
throws-like {push @arr, 123},
64+
#?rakudo todo 'code does not die, array shapes RT #124502'
65+
throws-like 'push @arr, 123',
6666
Exception,
6767
'boundary constraints on my @arr[num] of Type works';
6868
pop @arr; # remove the last item to ensure the next ones are type constraints
69-
throws-like {push @arr, 's'},
70-
Exception,
69+
throws-like q[push @arr, 's'],
70+
X::TypeCheck,
7171
'type constraints on my @arr[num] of Type works (1)';
72-
throws-like {push @arr, 4.2},
73-
Exception,
72+
throws-like 'push @arr, 4.2',
73+
X::TypeCheck,
7474
'type constraints on my @arr[num] of Type works (2)';
7575
}
7676

@@ -79,27 +79,28 @@ plan 25;
7979
is(@arr, <1 2 3 4 5>, 'my type @arr works');
8080
is push(@arr, 6), [1,2,3,4,5,6], 'push on native @arr works';
8181
# RT #125123'
82-
throws-like { EVAL 'push @arr, "s"' },
82+
throws-like 'push @arr, "s"',
8383
X::TypeCheck,
8484
'type constraints on my type @arr works (1)';
85-
throws-like { EVAL 'push @arr, 4.2' },
85+
throws-like 'push @arr, 4.2',
8686
X::TypeCheck,
8787
'type constraints on my type @arr works (2)';
8888
}
8989

90-
#?rakudo skip 'array shapes NYI RT #124502'
9190
{
9291
my int @arr[5] = <1 2 3 4 5>;
9392
is(@arr, <1 2 3 4 5>, 'my Type @arr[num] works');
9493

95-
throws-like {push @arr, 123},
96-
Exception,
97-
'boundary constraints on my Type @arr[num] works';
98-
pop @arr; # remove the last item to ensure the next ones are type constraints
99-
throws-like {push @arr, 's'},
100-
Exception, # XXX fix when this block is no longer skipped
101-
'type constraints on my Type @arr[num] works (1)';
102-
throws-like {push @arr, 4.2},
103-
Exception, # XXX fix when this block is no longer skipped
104-
'type constraints on my Type @arr[num] works (2)';
94+
throws-like 'push @arr, 123',
95+
X::IllegalOnFixedDimensionArray,
96+
operation => 'push';
97+
throws-like 'pop @arr',
98+
X::IllegalOnFixedDimensionArray,
99+
operation => 'pop';
100+
throws-like q[push @arr, 's'],
101+
X::IllegalOnFixedDimensionArray,
102+
operation => 'push';
103+
throws-like 'push @arr, 4.2',
104+
X::IllegalOnFixedDimensionArray,
105+
operation => 'push';
105106
}

0 commit comments

Comments
 (0)