Skip to content

Commit 13cbe9a

Browse files
committed
Sync OUTPUT with style in docs
Resolves issue #101, tests changed accordingly. Committable will now show exit code in a funny way (with nested «»). This has to be changed in the future.
1 parent bbede98 commit 13cbe9a

File tree

6 files changed

+58
-58
lines changed

6 files changed

+58
-58
lines changed

Bisectable.p6

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ method process($msg, $code is copy, $old, $new) {
199199
} else {
200200
$msg.reply: On both starting points (old=$short-old new=$short-new) the exit code is $old-result<exit-code> and the output is identical as well
201201
}
202-
return Output on both points: $old-result<output> # will be gisted automatically if required
202+
return Output on both points: «$old-result<output>» # will be gisted automatically if required
203203
}
204204

205205
my $dir = tempdir :!unlink;

Committable.p6

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,8 +111,8 @@ method process($msg, $config is copy, $code is copy) {
111111
}
112112

113113
my $short-str = @result == 1 && @result[0]<commits> > 3 && $config.chars < 20
114-
¦«{$config} ({+@result[0]<commits>} commits)»: {@result[0]<output>}
115-
¦ ~ @result.map({ «{.<commits>.join(,)}»: {.<output>} }).join: ¦;
114+
¦{$config} ({+@result[0]<commits>} commits): «{@result[0]<output>}»
115+
¦ ~ @result.map({ {.<commits>.join(,)}: «{.<output>}» }).join: ¦;
116116

117117
my $long-str = ¦ ~ @result.map({ «{.<commits>.join(,)}»: {.<output>} }).join: \n¦;
118118
return $short-str but ProperStr($long-str);

Evalable.p6

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ method process($message, $code is copy) {
8484
}
8585
}
8686

87-
my $reply-start = rakudo-moar $short-commit: OUTPUT«$extra;
87+
my $reply-start = rakudo-moar $short-commit: OUTPUT: «$extra;
8888
my $reply-end = »;
8989
if MESSAGE-LIMIT >= ($reply-start, $output, $reply-end).map(*.encode.elems).sum {
9090
return $reply-start ~ $output ~ $reply-end

t/bisectable.t

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -102,12 +102,12 @@ $t.test(‘inverted exit signal’,
102102
$t.test(nothing to bisect,
103103
bisect: say ‘hello world’; exit 42,
104104
/^ <me($t)>‘, On both starting points (old=2015.12 new=’<sha>‘) the exit code is 42 and the output is identical as well’ $/,
105-
{$t.our-nick}, Output on both points: hello world);
105+
{$t.our-nick}, Output on both points: «hello world»);
106106

107107
$t.test(nothing to bisect, segmentation fault everywhere,
108108
bisect: old=2016.02 new=2016.03 Buf.new(0xFE).decode("utf8-c8"),
109109
{$t.our-nick}, On both starting points (old=2016.02 new=2016.03) the exit code is 0, exit signal is 11 (SIGSEGV) and the output is identical as well,
110-
{$t.our-nick}, Output on both points:);
110+
{$t.our-nick}, Output on both points: «»);
111111

112112
$t.test(large output is uploaded,
113113
bisect: .say for ^1000; exit 5,
@@ -146,21 +146,21 @@ $t.test(‘swapped old and new revisions’,
146146
$t.test(‘special characters’,
147147
‘bisect: say (.chr for ^128).join’,
148148
/^ <me($t)>‘, On both starting points (old=2015.12 new=’<sha>‘) the exit code is 0 and the output is identical as well’ $/,
149-
{$t.our-nick}, Output on both points: ” ~ ‘␀␁␂␃␄␅␆␇␈␉␤␋␌␍␎␏␐␑␒␓␔␕␖␗␘␙␚␛␜␝␞␟ !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~␡’);
149+
{$t.our-nick}, Output on both points: ” ~ ‘«␀␁␂␃␄␅␆␇␈␉␤␋␌␍␎␏␐␑␒␓␔␕␖␗␘␙␚␛␜␝␞␟ !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~␡»’);
150150
}
151151

152152
$t.test(␤ works like an actual newline,
153153
bisect: # newline test ␤ say ‘hello world’; exit 42,
154154
/^ <me($t)>‘, On both starting points (old=2015.12 new=’<sha>‘) the exit code is 42 and the output is identical as well’ $/,
155-
{$t.our-nick}, Output on both points: hello world);
155+
{$t.our-nick}, Output on both points: «hello world»);
156156

157157
# URLs
158158

159159
$t.test(fetching code from urls,
160160
bisect: https://gist.githubusercontent.com/AlexDaniel/147bfa34b5a1b7d1ebc50ddc32f95f86/raw/9e90da9f0d95ae8c1c3bae24313fb10a7b766595/test.p6,
161161
{$t.our-nick}, Successfully fetched the code from the provided URL.,
162162
/^ <me($t)>‘, On both starting points (old=2015.12 new=’<sha>‘) the exit code is 0 and the output is identical as well’ $/,
163-
{$t.our-nick}, Output on both points: url test);
163+
{$t.our-nick}, Output on both points: «url test»);
164164

165165
$t.test(wrong url,
166166
bisect: http://github.org/sntoheausnteoahuseoau,

t/committable.t

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -48,27 +48,27 @@ $t.test(‘source link’,
4848

4949
$t.test(basic “nick:” query,
5050
{$t.bot-nick}: HEAD say ‘hello’,
51-
/^ <me($t)>‘, ¦«HEAD(’<sha>‘)»: hello’ $/);
51+
/^ <me($t)>‘, ¦HEAD(’<sha>‘): «hello» $/);
5252

5353
$t.test(basic “nick,” query,
5454
{$t.bot-nick}, HEAD say ‘hello’,
55-
/^ <me($t)>‘, ¦«HEAD(’<sha>‘)»: hello’ $/);
55+
/^ <me($t)>‘, ¦HEAD(’<sha>‘): «hello» $/);
5656

5757
$t.test(“commit:” shortcut,
5858
commit: HEAD say ‘hello’,
59-
/^ <me($t)>‘, ¦«HEAD(’<sha>‘)»: hello’ $/);
59+
/^ <me($t)>‘, ¦HEAD(’<sha>‘): «hello» $/);
6060

6161
$t.test(“commit,” shortcut,
6262
commit, HEAD say ‘hello’,
63-
/^ <me($t)>‘, ¦«HEAD(’<sha>‘)»: hello’ $/);
63+
/^ <me($t)>‘, ¦HEAD(’<sha>‘): «hello» $/);
6464

6565
$t.test(“commit6:” shortcut,
6666
commit6: HEAD say ‘hello’,
67-
/^ <me($t)>‘, ¦«HEAD(’<sha>‘)»: hello’ $/);
67+
/^ <me($t)>‘, ¦HEAD(’<sha>‘): «hello» $/);
6868

6969
$t.test(“commit6,” shortcut,
7070
commit6, HEAD say ‘hello’,
71-
/^ <me($t)>‘, ¦«HEAD(’<sha>‘)»: hello’ $/);
71+
/^ <me($t)>‘, ¦HEAD(’<sha>‘): «hello» $/);
7272

7373
$t.test(“commit” shortcut does not work,
7474
commit HEAD say ‘hello’);
@@ -78,7 +78,7 @@ $t.test(‘“commit6” shortcut does not work’,
7878

7979
$t.test(specific commit,
8080
commit: f583f22 say $*PERL.compiler.version,
81-
{$t.our-nick}, ¦«f583f22»: v2016.06.183.gf.583.f.22);
81+
{$t.our-nick}, ¦f583f22: «v2016.06.183.gf.583.f.22»);
8282

8383
$t.test(too long output is uploaded,
8484
commit: HEAD .say for ^1000,
@@ -88,67 +88,67 @@ $t.test(‘too long output is uploaded’,
8888

8989
$t.test(exit code,
9090
commit: 2015.12 say ‘foo’; exit 42,
91-
{$t.our-nick}, ¦«2015.12»: foo «exit code = 42»);
91+
{$t.our-nick}, ¦2015.12: «foo «exit code = 42»»);
9292

9393
$t.test(exit signal,
9494
commit: 2016.03 say ^1000 .grep: -> $n {([+] ^$n .grep: -> $m {$m and $n %% $m}) == $n },
95-
{$t.our-nick}, ¦«2016.03»: «exit signal = SIGSEGV (11)»);
95+
{$t.our-nick}, ¦2016.03: « «exit signal = SIGSEGV (11)»»);
9696

9797
# STDIN
9898

9999
$t.test(stdin,
100100
commit: HEAD say lines[0],
101-
/^ <me($t)>‘, ¦«HEAD(’<sha>‘)»: ♥🦋 ꒛㎲₊⼦🂴⧿⌟ⓜ≹℻ 😦⦀🌵 🖰㌲⎢➸ 🐍💔 🗭𐅹⮟⿁ ⡍㍷⽐’ $/);
101+
/^ <me($t)>‘, ¦HEAD(’<sha>‘): «♥🦋 ꒛㎲₊⼦🂴⧿⌟ⓜ≹℻ 😦⦀🌵 🖰㌲⎢➸ 🐍💔 🗭𐅹⮟⿁ ⡍㍷⽐» $/);
102102

103103
$t.test(set custom stdin,
104104
commit: stdIN custom string␤another line,
105105
{$t.our-nick}, STDIN is set to «custom string␤another line»);
106106

107107
$t.test(test custom stdin,
108108
committable6: HEAD dd lines,
109-
/^ <me($t)>‘, ¦«HEAD(’<sha>‘)»: ("custom string", "another line").Seq’ $/);
109+
/^ <me($t)>‘, ¦HEAD(’<sha>‘): «("custom string", "another line").Seq» $/);
110110

111111
$t.test(reset stdin,
112112
commit: stdIN rESet,
113113
{$t.our-nick}, STDIN is reset to the default value);
114114

115115
$t.test(test stdin after reset,
116116
commit: HEAD say lines[0],
117-
/^ <me($t)>‘, ¦«HEAD(’<sha>‘)»: ♥🦋 ꒛㎲₊⼦🂴⧿⌟ⓜ≹℻ 😦⦀🌵 🖰㌲⎢➸ 🐍💔 🗭𐅹⮟⿁ ⡍㍷⽐’ $/);
117+
/^ <me($t)>‘, ¦HEAD(’<sha>‘): «♥🦋 ꒛㎲₊⼦🂴⧿⌟ⓜ≹℻ 😦⦀🌵 🖰㌲⎢➸ 🐍💔 🗭𐅹⮟⿁ ⡍㍷⽐» $/);
118118

119119
$t.test(stdin line count,
120120
commit: HEAD say +lines,
121-
/^ <me($t)>‘, ¦«HEAD(’<sha>‘)»: 10 $/);
121+
/^ <me($t)>‘, ¦HEAD(’<sha>‘): «10» $/);
122122

123123
$t.test(stdin word count,
124124
commit: HEAD say +$*IN.words,
125-
/^ <me($t)>‘, ¦«HEAD(’<sha>‘)»: 100’ $/);
125+
/^ <me($t)>‘, ¦HEAD(’<sha>‘): «100» $/);
126126

127127
$t.test(stdin char count,
128128
commit: HEAD say +slurp.chars,
129-
/^ <me($t)>‘, ¦«HEAD(’<sha>‘)»: 500’ $/);
129+
/^ <me($t)>‘, ¦HEAD(’<sha>‘): «500» $/);
130130

131131
# Ranges and multiple commits
132132

133133
$t.test(“releases” query,
134134
commit: releases say $*PERL,
135-
/^ <{$t.our-nick}> ‘, ¦«releases (’\d+‘ commits)»: Perl 6 (6.c)’ $/);
135+
/^ <{$t.our-nick}> ‘, ¦releases (’\d+‘ commits): «Perl 6 (6.c)» $/);
136136

137137
$t.test(“v6c” query,
138138
commit: v6c say $*PERL,
139-
/^ <{$t.our-nick}> ‘, ¦«v6c (’\d+‘ commits)»: Perl 6 (6.c)’ $/);
139+
/^ <{$t.our-nick}> ‘, ¦v6c (’\d+‘ commits): «Perl 6 (6.c)» $/);
140140

141141
$t.test(“6.c” query,
142142
commit: 6.c say $*PERL,
143-
/^ <{$t.our-nick}> ‘, ¦«6.c (’\d+‘ commits)»: Perl 6 (6.c)’ $/);
143+
/^ <{$t.our-nick}> ‘, ¦6.c (’\d+‘ commits): «Perl 6 (6.c)» $/);
144144

145145
$t.test(“6c” query,
146146
commit: 6c say $*PERL,
147-
/^ <{$t.our-nick}> ‘, ¦«6c (’\d+‘ commits)»: Perl 6 (6.c)’ $/);
147+
/^ <{$t.our-nick}> ‘, ¦6c (’\d+‘ commits): «Perl 6 (6.c)» $/);
148148

149149
$t.test(“all” query (same output everywhere),
150150
commit: all say 'hi', # ASCII quotes because they are supported everywhere
151-
/^ <{$t.our-nick}> ‘, ¦«all (’\d+‘ commits)»: hi $/,
151+
/^ <{$t.our-nick}> ‘, ¦all (’\d+‘ commits): «hi» $/,
152152
:20timeout);
153153

154154
$t.test(“all” query (different output everywhere),
@@ -158,37 +158,37 @@ $t.test(‘“all” query (different output everywhere)’,
158158

159159
$t.test(multiple commits separated by comma,
160160
commit: 2016.02,2016.03,9ccd848,HEAD say ‘hello’,
161-
/^ <me($t)>‘, ¦«2016.02,2016.03,9ccd848,HEAD(’<sha>‘)»: hello’ $/);
161+
/^ <me($t)>‘, ¦2016.02,2016.03,9ccd848,HEAD(’<sha>‘): «hello» $/);
162162

163163
$t.test(commit~num syntax,
164164
commit: 2016.04~100,2016.04 say $*PERL.compiler.version,
165-
{$t.our-nick}, ¦«2016.04~100»: v2016.03.1.g.7.cc.37.b.3 ¦«2016.04»: v2016.04);
165+
{$t.our-nick}, ¦2016.04~100: «v2016.03.1.g.7.cc.37.b.3» ¦2016.04: «v2016.04»);
166166

167167
$t.test(commit^^^ syntax,
168168
commit: 2016.03^^^,2016.03^^,2016.03^,2016.03 say 42,
169-
{$t.our-nick}, ¦«2016.03^^^,2016.03^^,2016.03^,2016.03»: 42);
169+
{$t.our-nick}, ¦2016.03^^^,2016.03^^,2016.03^,2016.03: «42»);
170170

171171
$t.test(commit..commit range syntax,
172172
commit: 2016.07~73..2016.07~72 say ‘a’ x 9999999999999999999,
173-
/^ <{$t.our-nick}> ‘, ¦«8ea2ae8,586f784»: ¦«87e8067»: repeat count (-8446744073709551617) cannot be negative␤ in block <unit> at /tmp/’ \w+ line 1␤ «exit code = 1» $/);
173+
/^ <{$t.our-nick}> ‘, ¦8ea2ae8,586f784: «» ¦87e8067: «repeat count (-8446744073709551617) cannot be negative␤ in block <unit> at /tmp/’ \w+ line 1␤ «exit code = 1»» $/);
174174

175175
# Special characters
176176
#`{ What should we do with colors?
177177
$t.test(‘special characters’,
178178
‘commit: HEAD say (.chr for ^128).join’,
179-
$t.our-nick ~ ‘, ¦«HEAD(’<sha>‘)»: ␀␁␂␃␄␅␆␇␈␉␤␋␌␍␎␏␐␑␒␓␔␕␖␗␘␙␚␛␜␝␞␟ !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~␡’);
179+
$t.our-nick ~ ‘, ¦HEAD(’<sha>‘): «␀␁␂␃␄␅␆␇␈␉␤␋␌␍␎␏␐␑␒␓␔␕␖␗␘␙␚␛␜␝␞␟ !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~␡»’);
180180
181181
$t.test(‘␤ works like an actual newline’,
182182
‘commit: HEAD # This is a comment ␤ say 「hello world!」’,
183-
{$t.our-nick}, ¦«HEAD(’<sha>‘)»: hello world!”);
183+
{$t.our-nick}, ¦HEAD(’<sha>‘): «hello world!»”);
184184
}
185185

186186
# URLs
187187

188188
$t.test(fetching code from urls,
189189
commit: HEAD https://gist.githubusercontent.com/AlexDaniel/147bfa34b5a1b7d1ebc50ddc32f95f86/raw/9e90da9f0d95ae8c1c3bae24313fb10a7b766595/test.p6,
190190
{$t.our-nick}, Successfully fetched the code from the provided URL.,
191-
/^ <me($t)>‘, ¦«HEAD(’<sha>‘)»: url test’ $/);
191+
/^ <me($t)>‘, ¦HEAD(’<sha>‘): «url test» $/);
192192

193193
$t.test(wrong url,
194194
commit: HEAD http://github.org/sntoheausnteoahuseoau,
@@ -202,7 +202,7 @@ $t.test(‘wrong mime type’,
202202

203203
$t.test(last basic query, just in case, # keep it last in this file
204204
{$t.bot-nick}: HEAD say ‘hello’,
205-
/^ <me($t)>‘, ¦«HEAD(’<sha>‘)»: hello’ $/);
205+
/^ <me($t)>‘, ¦HEAD(’<sha>‘): «hello» $/);
206206

207207
done-testing;
208208
END $t.end;

0 commit comments

Comments
 (0)