commit 2b209eeffe22fb4d9608aeee997f126a488cbb7e
Author: Eirik A. Nygaard <eirikald@pvv.ntnu.no>
Date: Mon Aug 17 08:34:21 2009 +0200
Add test for pir exit operation.
diff --git a/t/op/exit.t b/t/op/exit.t
new file mode 100644
index 0000000..8692bdb
a
|
b
|
|
| 1 | #!perl |
| 2 | # Copyright (C) 2001-2008, Parrot Foundation. |
| 3 | # $Id$ |
| 4 | |
| 5 | use strict; |
| 6 | use warnings; |
| 7 | use lib qw( . lib ../lib ../../lib ); |
| 8 | |
| 9 | use Test::More; |
| 10 | use Parrot::Test tests => 2; |
| 11 | |
| 12 | =head1 NAME |
| 13 | |
| 14 | t/op/exit.t - Testing the exit pseudo-opcode |
| 15 | |
| 16 | =head1 SYNOPSIS |
| 17 | |
| 18 | % prove t/op/exit.t |
| 19 | |
| 20 | =head1 DESCRIPTION |
| 21 | |
| 22 | Test both success and failure exit status. |
| 23 | |
| 24 | =cut |
| 25 | |
| 26 | pir_exit_code_is( <<'CODE', <<'OUTPUT', 'exit with success' ); |
| 27 | .sub main |
| 28 | exit 0 |
| 29 | .end |
| 30 | CODE |
| 31 | 0 |
| 32 | OUTPUT |
| 33 | |
| 34 | pir_exit_code_is( <<'CODE', <<'OUTPUT', 'exit with failure' ); |
| 35 | .sub main |
| 36 | exit 1 |
| 37 | .end |
| 38 | CODE |
| 39 | 1 |
| 40 | OUTPUT |
| 41 | |
| 42 | # Local Variables: |
| 43 | # mode: cperl |
| 44 | # cperl-indent-level: 4 |
| 45 | # fill-column: 100 |
| 46 | # End: |
| 47 | # vim: expandtab shiftwidth=4: |