Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
pugs fudge
  • Loading branch information
coke committed Apr 5, 2012
1 parent cc341e3 commit 1c332ba
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions S04-statements/given.t
Expand Up @@ -21,6 +21,7 @@ Tests the given block, as defined in L<S04/"Switch statements">
ok(!$f, "given when false");
};

#?pugs skip 'proceed NYI'
{
# simple case, with fall through
# L<S04/Switch statements/If the smart match fails, control proceeds the
Expand All @@ -40,6 +41,7 @@ Tests the given block, as defined in L<S04/"Switch statements">
ok(!$unreached, "but didn't do so normally");
};

#?pugs todo
{
my $foo;
my $match;
Expand Down Expand Up @@ -91,6 +93,7 @@ Tests the given block, as defined in L<S04/"Switch statements">
ok(!$panic,"should not fall into default in this case");
}

#?pugs skip 'proceed NYI'
{
my ($foo, $bar) = (1, 0);
given 1 {
Expand All @@ -103,6 +106,7 @@ Tests the given block, as defined in L<S04/"Switch statements">
ok($bar, 'proceed does not prevent default');
}

#?pugs skip 'succeed NYI'
{
my ($foo, $bar) = (1, 0);
given 1 {
Expand All @@ -115,6 +119,7 @@ Tests the given block, as defined in L<S04/"Switch statements">
ok(!$bar, 'succeed prevents default');
}

#?pugs skip 'proceed NYI'
{
my ($foo, $bar, $baz, $bad) = (0, 0, -1, 0);
my $quux = 0;
Expand Down Expand Up @@ -147,6 +152,7 @@ Tests the given block, as defined in L<S04/"Switch statements">
}

# given/succeed returns the correct value:
#?pugs skip 'succeed NYI'
{
sub ret_test($arg) {
given $arg {
Expand Down Expand Up @@ -199,6 +205,7 @@ Tests the given block, as defined in L<S04/"Switch statements">
is($passed, 1,'when Type {}');
}

#?pugs skip "so NYI"
{
# given + true
# L<S04/"Switch statements" /"is exactly equivalent to">
Expand All @@ -225,6 +232,7 @@ Tests the given block, as defined in L<S04/"Switch statements">
}

# given + 0-arg closure
#?pugs skip 'parsefail'
{
my $x = 0;
given 41 {
Expand All @@ -235,6 +243,7 @@ Tests the given block, as defined in L<S04/"Switch statements">
}

# given + 1-arg closure
#?pugs skip 'parsefail'
{
my $x;
given 41 {
Expand All @@ -245,6 +254,7 @@ Tests the given block, as defined in L<S04/"Switch statements">
}

# given + n>1-arg closure (should fail)
#?pugs skip 'parsefail'
{
dies_ok {
given 41 {
Expand Down Expand Up @@ -274,6 +284,7 @@ Tests the given block, as defined in L<S04/"Switch statements">
}

# statement-modifying 'when'
#?pugs skip 'parsefail'
{
my $tracker = 1;
given 1 {
Expand All @@ -284,8 +295,10 @@ Tests the given block, as defined in L<S04/"Switch statements">

# RT #78234
eval_lives_ok 'given 3 { sub a() { } }', 'can define a sub inside a given';
#?pugs todo
eval_lives_ok 'sub a() { } given 3', 'can define a sub inside a statement-modifying given';

#?pugs skip 'ok variant?'
{
my $capture-is-correct = False;
given "Hello" {
Expand Down

0 comments on commit 1c332ba

Please sign in to comment.