Skip to content
This repository has been archived by the owner on Feb 3, 2021. It is now read-only.

Commit

Permalink
Add test for INIT statements.
Browse files Browse the repository at this point in the history
  • Loading branch information
pmichaud committed Oct 29, 2009
1 parent 501baec commit 773419c
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions t/nqp/33-init.t
@@ -0,0 +1,23 @@
#! nqp

# Test INIT blocks

INIT plan(4);

our $foo;

ok($foo == 2, 'after second INIT block');

INIT {
our $foo;
ok($foo == 0, 'first INIT');
$foo := 1;
}

$foo := 3;

INIT ok($foo++, 'after first INIT but before mainline');

ok($foo == 3, 'After everything else');


0 comments on commit 773419c

Please sign in to comment.