File: basic.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 (58 lines) | stat: -rw-r--r-- 1,350 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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
use Test::More tests => 2+2+5+3+3;

require(get_rinclude_path('common'));

my $cupt = setup(
	'dpkg_status' => [
		compose_installed_record('aa', '0.2016'),
		compose_installed_record('bb', '2.1-4'),
	],
	'packages' => [
		compose_package_record('aa', 3) . "Description: aa-desc\n",
		compose_package_record('dd', 4) . "Rtb: xy8pas\n",
	],
	'sources' => [
		compose_package_record('cc', 5) . "Build-Depends: aa\n",
		compose_package_record('ee', 8) . "Wqq: uiop\n",
	],
);
my $cupt_shell = get_shell($cupt);

sub test {
	my ($command, $extra_comment) = @_;
	$extra_comment = defined($extra_comment) ? " ($extra_comment)" : "";

	subtest "'$command'$extra_comment" => sub {
		test_output_identical_with_non_shell($cupt, $cupt_shell, $command);
	}
}

sub test_manage {
	my @params = @_;
	$params[0] .= " -s -y -N";
	test(@params);
}

test('help');
test('version');

test('policy');
test('policysrc');

test('show bb');
test('show aa');
TODO: {
	local $TODO = 'fix displaying extra fields';
	test('showsrc cc');
	test('show dd');
	test('showsrc ee');
}

test('show --installed-only bb');
test('show aa', 'non-installed package after --installed-only');
test('show --installed-only aa', '--installed-only after the cache is populated with also non-installed packages');

test_manage('install aa');
test_manage('remove bb');
test_manage('build-dep cc');