| 1 |
#!/usr/bin/perl |
| 2 |
|
| 3 |
use v5.14; |
| 4 |
use warnings; |
| 5 |
|
| 6 |
use Test2::V0; |
| 7 |
|
| 8 |
use lib "t"; |
| 9 |
use testcase "t::structures"; |
| 10 |
|
| 11 |
BEGIN { $^H{"t::structures/permit"} = 1; } |
| 12 |
|
| 13 |
# parens |
| 14 |
{ |
| 15 |
is( parens ( "abc" ), "abc", 'parenthesis container' ); |
| 16 |
} |
| 17 |
|
| 18 |
# args - parens are optional |
| 19 |
{ |
| 20 |
is( args ( "123" ), "123", 'arguments container with parens' ); |
| 21 |
is( args "123", "123", 'arguments container without parens' ); |
| 22 |
} |
| 23 |
|
| 24 |
# brackets |
| 25 |
{ |
| 26 |
is( brackets [ "def" ], "def", 'bracket container' ); |
| 27 |
} |
| 28 |
|
| 29 |
# braces |
| 30 |
{ |
| 31 |
is( braces { "ghi" }, "ghi", 'brace container' ); |
| 32 |
} |
| 33 |
|
| 34 |
# chevrons |
| 35 |
{ |
| 36 |
# takes a bareword identifier |
| 37 |
is( chevrons < jkl >, "jkl", 'chevron container' ); |
| 38 |
} |
| 39 |
|
| 40 |
done_testing; |