Debian Codegraph @

t/01-no-color.t

raw symbols ◀ ▶
Source reconstructed at patch state 0 of 1 — not the installed (fully patched) source.
1 Debian patch touch this file
1 #!/usr/bin/env perl
2
3 use 5.014000;
4 use warnings;
5
6 use Test::More;
7 use Capture::Tiny "capture";
8
9 binmode STDOUT, ":encoding(utf-8)";
10 binmode STDERR, ":encoding(utf-8)";
11 binmode DATA, ":encoding(utf-8)";
12
13 # localtime will differ on other machines
14 my %stamp = map { s{^Files/}{}r => "$_ ".localtime ((stat)[9]) } glob "Files/*";
15
16 local $/ = "** EOT **\n";
17 while (<DATA>) {
18 chomp;
19 my ($dsc, $f1, $f2, $opt, $exp) = split m/\n/, $_, 5;
20 $exp =~ s/STAMP:1/$stamp{$f1}/g;
21 $exp =~ s/STAMP:2/$stamp{$f2}/g;
22 #diag "Description: $dsc";
23 #diag "Options: $opt";
24 my @cmd = ($^X, "ccdiff", "--utf-8", "--no-color", "Files/$f1", "Files/$f2");
25 $opt and push @cmd, split m/ / => $opt;
26 #diag "@cmd";
27 my ($out, $err, $exit) = capture { system @cmd; };
28 is ($out, $exp, $dsc);
29 is ($err, "", "No error");
30 is ($exit, 0, "Success");
31 }
32
33 done_testing;
34
35 __END__
36 No options
37 01_1.txt
38 01_2.txt
39
40 < STAMP:1
41 > STAMP:2
42 3,3c3,3
43 < usu. Ad duo posse theophrastus, vim in accumsan
44 ---
45 > usu. Ad duo posse theophrastus. Vim in accumsan
46 ** EOT **
47 Unified with header
48 01_1.txt
49 01_2.txt
50 -u0
51 --- STAMP:1
52 +++ STAMP:2
53 3,3c3,3
54 -usu. Ad duo posse theophrastus, vim in accumsan
55 +usu. Ad duo posse theophrastus. Vim in accumsan
56 ** EOT **
57 No header
58 01_1.txt
59 01_2.txt
60 --no-header
61 3,3c3,3
62 < usu. Ad duo posse theophrastus, vim in accumsan
63 ---
64 > usu. Ad duo posse theophrastus. Vim in accumsan
65 ** EOT **
66 Unified with header
67 01_1.txt
68 01_2.txt
69 -u0
70 --- STAMP:1
71 +++ STAMP:2
72 3,3c3,3
73 -usu. Ad duo posse theophrastus, vim in accumsan
74 +usu. Ad duo posse theophrastus. Vim in accumsan
75 ** EOT **
76 Unified without header
77 01_1.txt
78 01_2.txt
79 -u0 --no-header
80 3,3c3,3
81 -usu. Ad duo posse theophrastus, vim in accumsan
82 +usu. Ad duo posse theophrastus. Vim in accumsan
83 ** EOT **
84 Unified with ascii markers
85 01_1.txt
86 01_2.txt
87 -mau0 --no-header
88 3,3c3,3
89 -usu. Ad duo posse theophrastus, vim in accumsan
90 - ^ ^
91 +usu. Ad duo posse theophrastus. Vim in accumsan
92 + ^ ^
93 ** EOT **
94 Unified with unicode markers
95 01_1.txt
96 01_2.txt
97 -mu0 --no-header
98 3,3c3,3
99 -usu. Ad duo posse theophrastus, vim in accumsan
100 - ▼ ▼
101 +usu. Ad duo posse theophrastus. Vim in accumsan
102 + ▲ ▲
103 ** EOT **
104 Unified with ascii markers and context
105 01_1.txt
106 01_2.txt
107 -mau1
108 --- STAMP:1
109 +++ STAMP:2
110 3,3c3,3
111 id vix cibo omittantur, et impetus offendit convenire
112 -usu. Ad duo posse theophrastus, vim in accumsan
113 - ^ ^
114 +usu. Ad duo posse theophrastus. Vim in accumsan
115 + ^ ^
116 efficiantur, sed in congue decore. Ex nullam iudicabit
117 ** EOT **
118 Unified with ascii verbose 1
119 01_1.txt
120 01_2.txt
121 -au0 -v1 --no-header
122 3,3c3,3
123 -usu. Ad duo posse theophrastus, vim in accumsan
124 - -- verbose : COMMA, LATIN SMALL LETTER V
125 +usu. Ad duo posse theophrastus. Vim in accumsan
126 + -- verbose : FULL STOP, LATIN CAPITAL LETTER V
127 ** EOT **
128 Unified with unicode verbose 1
129 01_1.txt
130 01_2.txt
131 -u0 -v1 --no-header
132 3,3c3,3
133 -usu. Ad duo posse theophrastus, vim in accumsan
134 - -- verbose : COMMA, LATIN SMALL LETTER V
135 +usu. Ad duo posse theophrastus. Vim in accumsan
136 + -- verbose : FULL STOP, LATIN CAPITAL LETTER V
137 ** EOT **
138 Unified with ascii verbose 2
139 01_1.txt
140 01_2.txt
141 -au0 -v2 --no-header
142 3,3c3,3
143 -usu. Ad duo posse theophrastus>,< >v<im in accumsan
144 - -- verbose : COMMA, LATIN SMALL LETTER V
145 +usu. Ad duo posse theophrastus>.< >V<im in accumsan
146 + -- verbose : FULL STOP, LATIN CAPITAL LETTER V
147 ** EOT **
148 Unified with unicode verbose 2
149 01_1.txt
150 01_2.txt
151 -u0 -v2 --no-header
152 3,3c3,3
153 -usu. Ad duo posse theophrastus↱,↰ ↱v↰im in accumsan
154 - -- verbose : COMMA, LATIN SMALL LETTER V
155 +usu. Ad duo posse theophrastus↱.↰ ↱V↰im in accumsan
156 + -- verbose : FULL STOP, LATIN CAPITAL LETTER V
157 ** EOT **