3 # Some tests for 'darcs changes'
6 use Test
::More
'no_plan';
13 my $test_name = 'record something';
18 like
(darcs
(q
(record
-A
'Mark Stosberg <a@b.com>' -a
-m foo date
.t
)), qr/finished recording/i, $test_name);
22 like
(darcs
(q
(changes date
.t
)), qr/foo/,'changes file.txt: trivial case works');
23 like
(darcs
(q
(changes
--last=1 date
.t
)), qr/foo/,'changes --last=1 file.txt');
24 like
(darcs
(q
(changes
--last=1 --summary date
.t
)),qr/foo/,'changes --last=1 --summary file.txt');
25 like
(darcs
(q
(changes
--last=1 --xml
)), qr/<a\@b.com>/,'changes --last=1 --xml encodes < and >');
29 # Add 50 records and try again
30 for (my $i = 0; $i <= 5; $i++) {
32 my $out = darcs
(qq(record
-a
-m
"foo record num $i" date
.t
));
33 like
( $out, qr/Finished record/i, "foo record num $i: success");
36 like
(darcs
(q
(changes date
.t
)), qr/foo/,'after 50 records: changes file.txt: trivial case works');
37 like
(darcs
(q
(changes
--last=1 date
.t
)), qr/foo/,'after 50 records: changes --last=1 file.txt');
38 like
(darcs
(q
(changes
--last=1 --summary date
.t
)),qr/foo/,'after 50 records: changes --last=1 --summary file.txt');
43 like
(darcs
(q
(changes
--context
--from
-patch
='num 1' --to
-patch
='num 4')),
44 qr/^\n.*\n\n.*num 4\n.*\n\n.*num 3\n.*\n\n.*num 2\n.*\n\n.*num 1\n.*\n$/,
45 'changes --context --from-patch="num 1$" --to-patch="num 4$"');
49 `date >>second_file.t`;
50 darcs
'add second_file.t';
51 like
(darcs
(q
(record
-a
-m adding_second_file second_file
.t
)), qr/finished recording/i, 'recorded second file');