File: 10_formatting.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 (39 lines) | stat: -rw-r--r-- 782 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
31
32
33
34
35
36
37
38
39
#!/usr/bin/perl -wT
use strict;
use Test::More tests => 5;

use_ok("IPC::System::Simple","run");

# A formatting bug caused ISS to mention its name twice in
# diagnostics.  These tests make sure it's fixed.


eval {
	run($^X);
};

like($@,qr{^IPC::System::Simple::run called with tainted argument},"Taint pkg only once");

eval {
	run(1);
};

like($@,qr{^IPC::System::Simple::run called with tainted environment},"Taint env only once");

# Delete everything in %ENV so we can't get taint errors.

my @keys = keys %ENV;

delete $ENV{$_} foreach @keys;

eval {
	run();
};

like($@,qr{^IPC::System::Simple::run called with no arguments},"Package mentioned only once");

eval {
	run([0]);
};

like($@,qr{^IPC::System::Simple::run called with no command},"Package mentioned only once");