File: 24-error.t

package info (click to toggle)
libsystem-sub-perl 0.162800-3
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, sid, trixie
  • size: 196 kB
  • sloc: perl: 253; sh: 6; makefile: 2
file content (23 lines) | stat: -rw-r--r-- 448 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
use strict;
use warnings;

use Test::More tests => 8;
use File::Spec;

use System::Sub exiterr => [
    0 => $^X,
    ARGV => [ File::Spec->catfile(qw(t exiterr.pl)) ],
    '()' => '$',
    '&?' => sub {
        my ($name, $code, $cmd) = @_;
        is($name, 'exiterr', 'name');
        is($cmd->[0], $^X, '$cmd[0]');
        is($?, $code, '$code == $?');
        is($? >> 8, $cmd->[2]);
    },
];

exiterr 4;
exiterr 5;

# vim:set et sw=4 sts=4: