Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Tests for .VAR.name
- Loading branch information
Showing
1 changed file
with
94 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,94 @@ | ||
| use v6; | ||
| use Test; | ||
|
|
||
| plan 15; | ||
|
|
||
| #?pugs skip "$a.VAR.name NYI" | ||
| #?niecza skip "$a.VAR.name NYI" | ||
| #?rakudo.jvm skip "oh no, .VAR does not work on JVM" | ||
| # not specifically typed | ||
| { | ||
| my $a; | ||
| is $a.VAR.name, '$a', "uninitialized untyped variable should have name"; | ||
| $a++; | ||
| is $a.VAR.name, '$a', "initialized untyped variable should have name"; | ||
| } #2 | ||
|
|
||
| #?pugs skip "Int $a.VAR.name NYI" | ||
| #?niecza skip "Int $a.VAR.name NYI" | ||
| #?rakudo.jvm skip "oh no, .VAR does not work on JVM" | ||
| # typed | ||
| { | ||
| my Int $a; | ||
| is $a.VAR.name, '$a', "uninitialized typed variable should have name"; | ||
| $a++; | ||
| is $a.VAR.name, '$a', "initialized typed variable should have name"; | ||
| } #2 | ||
|
|
||
| #?pugs skip "@a.VAR.name NYI" | ||
| #?niecza skip "@a.VAR.name NYI" | ||
| #?rakudo.jvm skip "oh no, .VAR does not work on JVM" | ||
| # not specifically typed | ||
| { | ||
| my @a; | ||
| is @a.VAR.name, '@a', "uninitialized untyped array should have name"; | ||
| @a.push(1); | ||
| is @a.VAR.name, '@a', "initialized untyped array should have name"; | ||
| } #2 | ||
|
|
||
| #?pugs skip "Int @a.VAR.name NYI" | ||
| #?niecza skip "Int @a.VAR.name NYI" | ||
| #?rakudo.jvm skip "oh no, .VAR does not work on JVM" | ||
| # typed | ||
| { | ||
| my Int @a; | ||
| is @a.VAR.name, '@a', "uninitialized typed array should have name"; | ||
| @a.push(1); | ||
| is @a.VAR.name, '@a', "initialized typed array should have name"; | ||
| } #2 | ||
|
|
||
| #?pugs skip "%a.VAR.name NYI" | ||
| #?niecza skip "%a.VAR.name NYI" | ||
| #?rakudo.jvm skip "oh no, .VAR does not work on JVM" | ||
| # not specifically typed | ||
| { | ||
| my %a; | ||
| is %a.VAR.name, '%a', "uninitialized untyped hash should have name"; | ||
| %a<o>++; | ||
| is %a.VAR.name, '%a', "initialized untyped hash should have name"; | ||
| } #2 | ||
|
|
||
| #?pugs skip "Int %a.VAR.name NYI" | ||
| #?niecza skip "Int %a.VAR.name NYI" | ||
| #?rakudo.jvm skip "oh no, .VAR does not work on JVM" | ||
| # typed | ||
| { | ||
| my Int %a; | ||
| is %a.VAR.name, '%a', "uninitialized typed hash should have name"; | ||
| %a<o>++; | ||
| is %a.VAR.name, '%a', "initialized typed hash should have name"; | ||
| } #2 | ||
|
|
||
| #?pugs skip "&a.VAR.name NYI" | ||
| #?niecza skip "&a.VAR.name NYI" | ||
| #?rakudo.jvm skip "oh no, .VAR does not work on JVM" | ||
| # not specifically typed | ||
| { | ||
| my &a; | ||
| is &a.VAR.name, '&a', "uninitialized untyped sub should have name"; | ||
| &a = -> { ... }; | ||
| is &a.VAR.name, '&a', "initialized untyped sub should have name"; | ||
| } #2 | ||
|
|
||
| #?pugs skip "Int &a.VAR.name NYI" | ||
| #?niecza skip "Int &a.VAR.name NYI" | ||
| #?rakudo.jvm skip "oh no, .VAR does not work on JVM" | ||
| # typed | ||
| { | ||
| my Int &a; | ||
| is &a.VAR.name, '&a', "uninitialized typed sub should have name"; | ||
| # &a = -> { ... }; | ||
| # is &a.VAR.name, '&a', "initialized typed sub should have name"; | ||
| } #2 | ||
|
|
||
| # vim: ft=perl6 |