Skip to content

Commit e285e61

Browse files
committed
Allow comma delimiter (for real this time)
Resolves #32. Also adds tests for #28 and #48.
1 parent 69a7126 commit e285e61

File tree

2 files changed

+33
-9
lines changed

2 files changed

+33
-9
lines changed

Bisectable.p6

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -131,15 +131,15 @@ method test-commit($code-file, :$old-exit-code, :$old-exit-signal, :$old-output)
131131
}
132132

133133
my regex spaceeq { \s* ‘=’ \s* | \s+ }
134-
my regex delim { \s* | ‘,’ }
134+
my regex delim { \s* [ ‘,’ \s* ]? }
135135
my regex bisect-cmd { :i
136136
^ \s*
137137
[
138-
[ [old|good] <&spaceeq> $<old>=\S+ <&delim> ]
139-
[ [new|bad] <&spaceeq> $<new>=\S+ \s* ]?
138+
[ [old|good] <&spaceeq> $<old>=<-[\s,]>+ <&delim> ]
139+
[ [new|bad] <&spaceeq> $<new>=\S+ \s* ]?
140140
|
141-
[ [new|bad] <&spaceeq> $<new>=\S+ <&delim> ]?
142-
[ [old|good] <&spaceeq> $<old>=\S+ \s* ]?
141+
[ [new|bad] <&spaceeq> $<new>=<-[\s,]>+ <&delim> ]?
142+
[ [old|good] <&spaceeq> $<old>=\S+ \s* ]?
143143
]
144144
$<code>=.*
145145
$

t/bisectable.t

Lines changed: 28 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -125,22 +125,46 @@ $t.test(‘exit code on new revision is 125’,
125125
# Custom starting points
126126

127127
$t.test(custom starting points,
128-
bisect: old=2016.02 new 2016.03 say (^∞).grep({ last })[5],
128+
bisect: old=2016.02 new 2016.03 say (^∞).grep({ last })[5],
129129
{$t.our-nick}, Bisecting by output (old=2016.02 new=2016.03) because on both starting points the exit code is 0,
130130
{$t.our-nick}, bisect log: https://whatever.able/fakeupload,
131131
{$t.our-nick}, (2016-03-18) https://github.com/rakudo/rakudo/commit/6d120cab6d0bf55a3c96fd3bd9c2e841e7eb99b0);
132132

133133
$t.test(custom starting points using “bad” and “good” terms,
134-
bisect: good 2016.02 bad=2016.03 say (^∞).grep({ last })[5],
134+
bisect: good 2016.02 bad=2016.03 say (^∞).grep({ last })[5],
135135
{$t.our-nick}, Bisecting by output (old=2016.02 new=2016.03) because on both starting points the exit code is 0,
136136
{$t.our-nick}, bisect log: https://whatever.able/fakeupload,
137137
{$t.our-nick}, (2016-03-18) https://github.com/rakudo/rakudo/commit/6d120cab6d0bf55a3c96fd3bd9c2e841e7eb99b0);
138138

139139
$t.test(swapped old and new revisions,
140-
bisect: old 2016.03 new 2016.02 say (^∞).grep({ last })[5],
140+
bisect: old 2016.03 new 2016.02 say (^∞).grep({ last })[5],
141141
{$t.our-nick}, bisect log: https://whatever.able/fakeupload,
142142
{$t.our-nick}, bisect init failure. See the log for more details);
143143

144+
$t.test(mixed case “old”/“new”,
145+
bisect: oLD 2016.02 NeW = 2016.03 say (^∞).grep({ last })[5],
146+
{$t.our-nick}, Bisecting by output (old=2016.02 new=2016.03) because on both starting points the exit code is 0,
147+
{$t.our-nick}, bisect log: https://whatever.able/fakeupload,
148+
{$t.our-nick}, (2016-03-18) https://github.com/rakudo/rakudo/commit/6d120cab6d0bf55a3c96fd3bd9c2e841e7eb99b0);
149+
150+
$t.test(comma to separate old=/new=,
151+
bisect: old 2016.02, new= 2016.03 say (^∞).grep({ last })[5],
152+
{$t.our-nick}, Bisecting by output (old=2016.02 new=2016.03) because on both starting points the exit code is 0,
153+
{$t.our-nick}, bisect log: https://whatever.able/fakeupload,
154+
{$t.our-nick}, (2016-03-18) https://github.com/rakudo/rakudo/commit/6d120cab6d0bf55a3c96fd3bd9c2e841e7eb99b0);
155+
156+
$t.test(mixed term styles,
157+
bisect: old =2016.02 , bad= 2016.03 say (^∞).grep({ last })[5],
158+
{$t.our-nick}, Bisecting by output (old=2016.02 new=2016.03) because on both starting points the exit code is 0,
159+
{$t.our-nick}, bisect log: https://whatever.able/fakeupload,
160+
{$t.our-nick}, (2016-03-18) https://github.com/rakudo/rakudo/commit/6d120cab6d0bf55a3c96fd3bd9c2e841e7eb99b0);
161+
162+
$t.test(mixed term styles,
163+
bisect: good 2016.02,new 2016.03 say (^∞).grep({ last })[5],
164+
{$t.our-nick}, Bisecting by output (old=2016.02 new=2016.03) because on both starting points the exit code is 0,
165+
{$t.our-nick}, bisect log: https://whatever.able/fakeupload,
166+
{$t.our-nick}, (2016-03-18) https://github.com/rakudo/rakudo/commit/6d120cab6d0bf55a3c96fd3bd9c2e841e7eb99b0);
167+
144168
# Special characters
145169
#`{ What should we do with colors?
146170
$t.test(‘special characters’,
@@ -195,7 +219,7 @@ $t.test(‘Did you mean some commit? (old)’,
195219

196220
$t.test(:21timeout, timeout,
197221
bisect: say ‘Zzzz…’; sleep ∞,
198-
/^ <me($t)>‘, On both starting points (old=2015.12 new=9d7c0ab) the exit code is 0, exit signal is 1 (SIGHUP) and the output is identical as well’ $/,
222+
/^ <me($t)>‘, On both starting points (old=2015.12 new=<sha>) the exit code is 0, exit signal is 1 (SIGHUP) and the output is identical as well’ $/,
199223
{$t.our-nick}, Output on both points: «Zzzz…␤«timed out after 10 seconds»»);
200224

201225
# TODO test timeouts during bisection

0 commit comments

Comments
 (0)