-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy path28info.t
46 lines (39 loc) · 1.46 KB
/
28info.t
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
#!/usr/bin/perl -w
use Test::More tests => 17;
use strict;
use SVK::Test;
our $output;
my ($xd, $svk) = build_test();
my ($copath, $corpath) = get_copath ('info');
my ($repospath, undef, $repos) = $xd->find_repos ('//', 1);
$svk->mkdir ('//info-root', '-m', '');
$svk->checkout ('//info-root', $copath);
is_output_like ($svk, 'info', [], qr'not a checkout path');
ok ($svk->info () > 0);
chdir ($copath);
my @depot_info = ("Depot Path: //info-root", "Revision: 1", "Last Changed Rev.: 1", qr{\ALast Changed Date: \d+-\d+-\d+\z}, "");
my @co_info = ("Checkout Path: $corpath", @depot_info);
ok ($svk->info () == 0);
is_output ($svk, 'info', [], \@co_info);
is_output ($svk, 'info', [''], \@co_info);
is_output ($svk, 'info', [$corpath], \@co_info);
is_output ($svk, 'info', ['//info-root'], \@depot_info);
$svk->rm ('//info-root', '-m', '');
ok ($svk->info () == 0);
is_output ($svk, 'info', [], \@co_info);
is_output ($svk, 'info', [''], \@co_info);
is_output ($svk, 'info', [$corpath], \@co_info);
ok ($svk->info ('//info-root') > 0);
is_output($svk, 'info', ['//info-root'],
['Path //info-root does not exist.']);
is_output($svk, 'info', ['blah'],
['Path //info-root/blah does not exist.']);
is_output($svk, 'info', ['//info-root@1'],
\@depot_info);
is_output($svk, 'cp', ['//info-root@1', 'blah'],
['A blah']);
# XXX: schedule info etc
is_output($svk, 'info', ['blah'],
[__("Checkout Path: $corpath/blah"),
'Depot Path: //info-root/blah',
'Revision: 1', '']);