File: internal.t

package info (click to toggle)
libipc-system-simple-perl 1.30-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 256 kB
  • sloc: perl: 908; makefile: 4
file content (30 lines) | stat: -rw-r--r-- 644 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#!/usr/bin/perl -w
use strict;
use Test::More tests => 3;
use IPC::System::Simple;

# These tests are for testing internal subroutines, and may change
# in the future.

*_check_exit = \&IPC::System::Simple::_check_exit;


is(_check_exit("command",1,[0..5]), 1, "Successful exit");

eval { 
	_check_exit("command",127,[0..5], 1);
};

like($@,qr{unexpectedly returned exit value},"Failed exit");

SKIP: {
	skip("Non-Win32 only", 1) if IPC::System::Simple::WINDOWS;

	# _spawn_or_die should croak on non-Windows systems.

	eval {
		IPC::System::Simple::_spawn_or_die();
	};

	like($@, qr{Internal error},"_spawn_or_die fails under non-Win32");
};