Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Add tests for RT #117777
  • Loading branch information
Mouq committed Mar 12, 2015
1 parent e7442ea commit 9a695d3
Showing 1 changed file with 20 additions and 1 deletion.
21 changes: 20 additions & 1 deletion S32-scalar/undef.t
Expand Up @@ -23,7 +23,7 @@ perl6-specific tests.
#
# Larry

plan 86;
plan 93;

our $GLOBAL;

Expand Down Expand Up @@ -340,6 +340,25 @@ lives_ok { uc(EVAL("")) }, 'can use EVAL("") in further expressions';
ok !defined(foo()), 'can undefine $a twice without any troubles';
}

# RT #117777
{
my $a = "foo";
undefine($a) = "bar";
is $a, "bar", "undefine is rw";
my $b = my $c = my $d is default(42) = "foo";
{
undefine temp $b;
temp undefine($c);
temp undefine($d) = "baz";
is $b, Any, "Can undefine temp \$var";
is $c, Any, "Can temp undefine \$var";
is $d, "baz", "Can temp undefine \$var + assignment";
}
is $b, "foo", "temp restores value before undefine";
is $c, Any, "temp restores value after undefine";
is $d, 42, "temp restore default value after undefine";
}

done;

# vim: ft=perl6

0 comments on commit 9a695d3

Please sign in to comment.