update readmes
[git-darcs-import.git] / tests / whatsnew.pl
blob71103059628639bb964024be46ede12fd9753e54
1 #!/usr/bin/env perl
3 # Some tests for 'darcs whatsnew '
5 use lib 'lib/perl';
6 use Test::More 'no_plan';
7 use Shell::Command;
8 use Test::Darcs;
9 use Shell::Command;
10 use File::Slurp;
11 use strict;
12 use Cwd 'abs_path';
14 init_tmp_repo();
17 my $testname = "RT#505 whatsnew -s after removal of file without a newline";
18 write_file('foo',"foobar");
19 like ( darcs('record -la -m "add foo"'), qr/Finished record/,
20 'recorded patch adding foo');
21 rm_rf 'foo';
22 like ( darcs('whatsnew -s'), qr/R/, $testname );
23 darcs 'record -a -m "remove foo"';
27 my $test_name = 'RT#245 --look-for-adds implies --summary';
28 touch('look_summary.txt');
29 like( darcs('whatsnew -l'), qr!a ./look_summary.txt!i, $test_name);
33 my $test_name = 'whatsnew works with uncommon file names';
35 if ($^O =~ /(msys|win32)/i) {
36 pass 'test does not work on windows';
37 } else {
38 touch(qw/\\/);
40 my $before = darcs(qw/add \\\\/);
41 my $what = darcs 'whatsnew';
42 unlike($what, qr/no changes/i, $test_name);
46 my $test_name = 'whatsnew works with absolute paths';
47 my $abs_repo_path = abs_path();
48 write_file('date.t','date.t');
49 touch 'date.t';
50 darcs 'add date.t';
51 like( darcs(qq{whatsnew "$abs_repo_path/date.t"}), qr/hunk/i, $test_name);