commit 2b209eeffe22fb4d9608aeee997f126a488cbb7e Author: Eirik A. Nygaard 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 --- /dev/null +++ b/t/op/exit.t @@ -0,0 +1,47 @@ +#!perl +# Copyright (C) 2001-2008, Parrot Foundation. +# $Id$ + +use strict; +use warnings; +use lib qw( . lib ../lib ../../lib ); + +use Test::More; +use Parrot::Test tests => 2; + +=head1 NAME + +t/op/exit.t - Testing the exit pseudo-opcode + +=head1 SYNOPSIS + + % prove t/op/exit.t + +=head1 DESCRIPTION + +Test both success and failure exit status. + +=cut + +pir_exit_code_is( <<'CODE', <<'OUTPUT', 'exit with success' ); +.sub main + exit 0 +.end +CODE +0 +OUTPUT + +pir_exit_code_is( <<'CODE', <<'OUTPUT', 'exit with failure' ); +.sub main + exit 1 +.end +CODE +1 +OUTPUT + +# Local Variables: +# mode: cperl +# cperl-indent-level: 4 +# fill-column: 100 +# End: +# vim: expandtab shiftwidth=4: