File: tokenising.t

package info (click to toggle)
cupt 2.10.4%2Bnmu2
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 3,144 kB
  • sloc: cpp: 23,642; perl: 1,599; sh: 40; makefile: 19
file content (28 lines) | stat: -rw-r--r-- 770 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
24
25
26
27
28
use Test::More tests => 6+1;

require(get_rinclude_path('common'));

my $cupt = setup(
	'dpkg_status' => [ compose_installed_record('ii', 2) ],
	'packages' => [ compose_package_record('pp', 1) ],
);
my $base_command;

sub test {
	my ($command, $comment) = @_;
	subtest $comment => sub {
		test_output_identical_with_non_shell($cupt, get_shell($cupt), $command, $base_command);
	}
}

$base_command = 'show pp';
test('show pp ', 'space after parameters');
test('show   pp', 'space before parameters');
test('  show pp', 'space before command');
test("show 'pp'", 'single quotes around parameter');
test("'show' pp", 'single quotes around command');
test('show "pp"', 'double quotes');

$base_command = 'satisfy ii';
test('satisfy "ii, ii"', 'spaces within a parameter');