Ticket #834: test-exit-op.patch

File test-exit-op.patch, 1.0 KB (added by eirik, 12 years ago)
  • (a) /dev/null vs. (b) b/t/op/exit.t

    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 
     5use strict; 
     6use warnings; 
     7use lib qw( . lib ../lib ../../lib ); 
     8 
     9use Test::More; 
     10use Parrot::Test tests => 2; 
     11 
     12=head1 NAME 
     13 
     14t/op/exit.t - Testing the exit pseudo-opcode 
     15 
     16=head1 SYNOPSIS 
     17 
     18    % prove t/op/exit.t 
     19 
     20=head1 DESCRIPTION 
     21 
     22Test both success and failure exit status. 
     23 
     24=cut 
     25 
     26pir_exit_code_is( <<'CODE', <<'OUTPUT', 'exit with success' ); 
     27.sub main 
     28    exit 0 
     29.end 
     30CODE 
     310 
     32OUTPUT 
     33 
     34pir_exit_code_is( <<'CODE', <<'OUTPUT', 'exit with failure' ); 
     35.sub main 
     36    exit 1 
     37.end 
     38CODE 
     391 
     40OUTPUT 
     41 
     42# Local Variables: 
     43#   mode: cperl 
     44#   cperl-indent-level: 4 
     45#   fill-column: 100 
     46# End: 
     47# vim: expandtab shiftwidth=4: