Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

[t] move lvalue_deep_brackets.t to spec/

git-svn-id: http://svn.pugscode.org/pugs@26247 c213334d-75ef-0310-aa23-eaa082d1ae64
  • Loading branch information...
commit 1d7cb1f31eb7fae8ef78a4280186d946eca76fa0 1 parent 530aadf
moritz authored
Showing with 46 additions and 0 deletions.
  1. +46 −0 S09-autovivification/autoincrement.t
46 S09-autovivification/autoincrement.t
View
@@ -0,0 +1,46 @@
+use v6;
+use Test;
+
+# L<S09/Autovivification/>
+
+plan 7;
+
+{
+ my $foo = 0;
+ $foo++;
+ is $foo, 1, 'lvalue $var works';
+}
+
+{
+ my $foo = [0];
+ $foo[0]++;
+ is $foo[0], 1, 'lvalue $var[] works';
+}
+
+{
+ my $foo = [[0]];
+ $foo[0][0]++;
+ is $foo[0][0], 1, 'lvalue $var[][] works';
+}
+
+{
+ my @foo = [0];
+ @foo[0][0]++;
+ is @foo[0][0], 1, 'lvalue @var[][] works';
+}
+
+{
+ is ++[[0]][0][0], 1, 'lvalue [[]][][] works';
+}
+
+{
+ my $foo = {a => [0]};
+ $foo<a>[0]++;
+ is $foo<a>[0], 1, 'lvalue $var<>[] works';
+}
+
+{
+ my %foo = (a => [0]);
+ %foo<a>[0]++;
+ is %foo<a>[0], 1, 'lvalue %var<>[] works';
+}
Please sign in to comment.
Something went wrong with that request. Please try again.