Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 49 lines (38 sloc) 0.613 kB
1d7cb1f [t] move lvalue_deep_brackets.t to spec/
moritz authored
1 use v6;
2 use Test;
3
4 # L<S09/Autovivification/>
5
6 plan 7;
7
8 {
9 my $foo = 0;
10 $foo++;
11 is $foo, 1, 'lvalue $var works';
12 }
13
14 {
15 my $foo = [0];
16 $foo[0]++;
17 is $foo[0], 1, 'lvalue $var[] works';
18 }
19
20 {
21 my $foo = [[0]];
22 $foo[0][0]++;
23 is $foo[0][0], 1, 'lvalue $var[][] works';
24 }
25
26 {
27 my @foo = [0];
28 @foo[0][0]++;
29 is @foo[0][0], 1, 'lvalue @var[][] works';
30 }
31
32 {
33 is ++[[0]][0][0], 1, 'lvalue [[]][][] works';
34 }
35
36 {
37 my $foo = {a => [0]};
38 $foo<a>[0]++;
39 is $foo<a>[0], 1, 'lvalue $var<>[] works';
40 }
41
42 {
43 my %foo = (a => [0]);
44 %foo<a>[0]++;
45 is %foo<a>[0], 1, 'lvalue %var<>[] works';
46 }
7f29bc5 [t/spec] Add vim: lines everywhere.
kyle authored
47
48 # vim: ft=perl6
Something went wrong with that request. Please try again.