blob: 05bdb0fd8b99d6d3266a59b7927153de9928181d (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
#!/usr/bin/env perl
## Copyright © 2010 by Daniel Friesel <derf@finalrewind.org>
## License: WTFPL <http://sam.zoy.org/wtfpl>
use strict;
use warnings;
use 5.010;
use Test::Command tests => 6;
my $aw = 'bin/apt-why';
my $re_usage =
qr{Usage: \S*apt-why \[options\] <package>; see \S*apt-why --help};
my $cmd = Test::Command->new(cmd => "$aw");
$cmd->exit_isnt_num(0);
$cmd->stdout_is_eq('');
$cmd->stderr_like($re_usage);
$cmd = Test::Command->new(cmd => "$aw does-not-exist");
$cmd->exit_isnt_num(0);
$cmd->stdout_is_eq('');
$cmd->stderr_is_eq("No such package: does-not-exist\n");
|