Skip to content

Commit

Permalink
Add trailing newlines to tests
Browse files Browse the repository at this point in the history
Adapting tests to the new behavior, see this commit:
2ae0d70
  • Loading branch information
AlexDaniel committed Jan 27, 2018
1 parent 9c03642 commit a06d59d
Show file tree
Hide file tree
Showing 3 changed files with 65 additions and 65 deletions.
12 changes: 6 additions & 6 deletions t/bisectable.t
Expand Up @@ -48,7 +48,7 @@ $t.test(‘inverted exit signal’,
$t.test(nothing to bisect,
bisect: say ‘hello world’; exit 42,
/^ <me($t)>‘, On both starting points (old=2015.12 new=’<sha>‘) the exit code is 42 and the output is identical as well’ $/,
{$t.our-nick}, Output on both points: «hello world»);
{$t.our-nick}, Output on both points: «hello world»);

$t.test(nothing to bisect, segmentation fault everywhere,
bisect: old=2016.02 new=2016.03 Buf.new(0xFE).decode(‘utf8-c8’),
Expand Down Expand Up @@ -116,33 +116,33 @@ $t.test(‘mixed term styles’,
$t.test(‘special characters’,
‘bisect: say (.chr for ^128).join’,
/^ <me($t)>‘, On both starting points (old=2015.12 new=’<sha>‘) the exit code is 0 and the output is identical as well’ $/,
{$t.our-nick}, Output on both points: ” ~ ‘«␀␁␂␃␄␅␆␇␈␉␤␋␌␍␎␏␐␑␒␓␔␕␖␗␘␙␚␛␜␝␞␟ !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~␡»’);
{$t.our-nick}, Output on both points: ” ~ ‘«␀␁␂␃␄␅␆␇␈␉␤␋␌␍␎␏␐␑␒␓␔␕␖␗␘␙␚␛␜␝␞␟ !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~␡»’);
}

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

# URLs

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

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

$t.test(comment after a url (without #),
bisect: https://gist.githubusercontent.com/AlexDaniel/147bfa34b5a1b7d1ebc50ddc32f95f86/raw/9e90da9f0d95ae8c1c3bae24313fb10a7b766595/test.p6 ← like this!,
{$t.our-nick}, Successfully fetched the code from the provided URL.,
/^ <me($t)>‘, On both starting points (old=2015.12 new=’<sha>‘) the exit code is 0 and the output is identical as well’ $/,
{$t.our-nick}, Output on both points: «url test»);
{$t.our-nick}, Output on both points: «url test»);

$t.test(wrong url,
bisect: http://github.com/sntoheausnteoahuseoau,
Expand Down
70 changes: 35 additions & 35 deletions t/committable.t
Expand Up @@ -24,19 +24,19 @@ $t.test(‘fallback’,

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

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

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

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

$t.test(“commit” shortcut does not work,
commit HEAD say ‘hello’);
Expand All @@ -52,7 +52,7 @@ $t.test(「“c:/” is a path and therefore does not work」,

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

$t.test(too long output is uploaded,
commit: HEAD .say for ^1000,
Expand All @@ -62,7 +62,7 @@ $t.test(‘too long output is uploaded’,

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

$t.test(exit signal,
commit: 2016.03 say ^1000 .grep: -> $n {([+] ^$n .grep: -> $m {$m and $n %% $m}) == $n },
Expand All @@ -72,51 +72,51 @@ $t.test(‘exit signal’,

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

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

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

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

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

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

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

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

$t.test(stdin numbers,
commit: HEAD say slurp().comb(/\d+/),
/^ <me($t)>‘, ¦HEAD(’<sha>‘): «(4𝟮)»’/);
/^ <me($t)>‘, ¦HEAD(’<sha>‘): «(4𝟮)»’/);

$t.test(stdin words,
commit: HEAD say slurp().comb(/\w+/),
/^ <me($t)>‘, ¦HEAD(’<sha>‘): «(hello world 4𝟮)»’/);
/^ <me($t)>‘, ¦HEAD(’<sha>‘): «(hello world 4𝟮)»’/);

$t.test(stdin No,
commit: HEAD say slurp().comb(/<:No>+/),
/^ <me($t)>‘, ¦HEAD(’<sha>‘): «(½)»’/);
/^ <me($t)>‘, ¦HEAD(’<sha>‘): «(½)»’/);

$t.test(stdin Nl,
commit: HEAD say slurp().comb(/<:Nl>+/),
/^ <me($t)>‘, ¦HEAD(’<sha>‘): «(Ⅵ)»’/);
/^ <me($t)>‘, ¦HEAD(’<sha>‘): «(Ⅵ)»’/);

$t.test(huge stdin is not replied back fully,
commit: stdin https://raw.githubusercontent.com/perl6/mu/master/misc/camelia.txt,
Expand All @@ -127,27 +127,27 @@ $t.test(‘huge stdin is not replied back fully’,

$t.test(“releases” query,
commit: releases say $*PERL,
/^ $($t.our-nick) ‘, ¦releases (’\d+‘ commits): «Perl 6 (6.c)»’ $/,
/^ $($t.our-nick) ‘, ¦releases (’\d+‘ commits): «Perl 6 (6.c)»’ $/,
:20timeout);

$t.test(“v6c” query,
commit: v6c say $*PERL,
/^ $($t.our-nick) ‘, ¦v6c (’\d+‘ commits): «Perl 6 (6.c)»’ $/,
/^ $($t.our-nick) ‘, ¦v6c (’\d+‘ commits): «Perl 6 (6.c)»’ $/,
:20timeout);

$t.test(“6.c” query,
commit: 6.c say $*PERL,
/^ $($t.our-nick) ‘, ¦6.c (’\d+‘ commits): «Perl 6 (6.c)»’ $/,
/^ $($t.our-nick) ‘, ¦6.c (’\d+‘ commits): «Perl 6 (6.c)»’ $/,
:20timeout);

$t.test(“6c” query,
commit: 6c say $*PERL,
/^ $($t.our-nick) ‘, ¦6c (’\d+‘ commits): «Perl 6 (6.c)»’ $/,
/^ $($t.our-nick) ‘, ¦6c (’\d+‘ commits): «Perl 6 (6.c)»’ $/,
:20timeout);

$t.test(“what:” query,
what: say $*PERL,
/^ $($t.our-nick) ‘, ¦6c (’\d+‘ commits): «Perl 6 (6.c)»’ $/,
/^ $($t.our-nick) ‘, ¦6c (’\d+‘ commits): «Perl 6 (6.c)»’ $/,
:20timeout);

$t.test(“what,” does not work,
Expand All @@ -158,7 +158,7 @@ $t.test(‘“6c,” does not work’,

$t.test(“all” query (same output everywhere),
commit: all say 'hi', # ASCII quotes because they are supported everywhere
/^ $($t.our-nick) ‘, ¦all (’\d+‘ commits): «hi»’ $/,
/^ $($t.our-nick) ‘, ¦all (’\d+‘ commits): «hi»’ $/,
:30timeout);

$t.test(“all” query (different output everywhere),
Expand All @@ -168,51 +168,51 @@ $t.test(‘“all” query (different output everywhere)’,

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

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

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

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

$t.test(very old tags,
commit: 2014.01,2014.02,2014.03 say 42,
{$t.our-nick}, ¦2014.01,2014.02,2014.03: «42»);
{$t.our-nick}, ¦2014.01,2014.02,2014.03: «42»);

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

# URLs

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

$t.test(comment after a url,
commit: HEAD https://gist.githubusercontent.com/AlexDaniel/147bfa34b5a1b7d1ebc50ddc32f95f86/raw/9e90da9f0d95ae8c1c3bae24313fb10a7b766595/test.p6 # this is a comment,
{$t.our-nick}, Successfully fetched the code from the provided URL.,
/^ <me($t)>‘, ¦HEAD(’<sha>‘): «url test»’ $/);
/^ <me($t)>‘, ¦HEAD(’<sha>‘): «url test»’ $/);

$t.test(comment after a url (without #),
commit: HEAD https://gist.githubusercontent.com/AlexDaniel/147bfa34b5a1b7d1ebc50ddc32f95f86/raw/9e90da9f0d95ae8c1c3bae24313fb10a7b766595/test.p6 ← like this!,
{$t.our-nick}, Successfully fetched the code from the provided URL.,
/^ <me($t)>‘, ¦HEAD(’<sha>‘): «url test»’ $/);
/^ <me($t)>‘, ¦HEAD(’<sha>‘): «url test»’ $/);

$t.test(wrong url,
commit: HEAD http://github.com/sntoheausnteoahuseoau,
Expand Down Expand Up @@ -246,15 +246,15 @@ $t.test(‘Did you mean some commit?’,
{$t.our-nick}, ¦d2c5694: «Cannot find this revision (did you mean “d2c5684”?)»);
$t.test(Only one commit is wrong (did you mean … ?),
commit: 2015.13,2015.12^ say 42,
{$t.our-nick}, ¦2015.13: «Cannot find this revision (did you mean “2015.12”?)» ¦2015.12^: «42»);
{$t.our-nick}, ¦2015.13: «Cannot find this revision (did you mean “2015.12”?)» ¦2015.12^: «42»);
$t.test(Both commits are wrong (did you mean … ?),
commit: 2015.12^,2015.13,69fecb52eb2 say 42,
{$t.our-nick}, ¦2015.12^: «42» ¦2015.13: «Cannot find this revision (did you mean “2015.12”?)» ¦69fecb5: «Cannot find this revision (did you mean “c9ebfc2”?)»);
{$t.our-nick}, ¦2015.12^: «42» ¦2015.13: «Cannot find this revision (did you mean “2015.12”?)» ¦69fecb5: «Cannot find this revision (did you mean “c9ebfc2”?)»);

$t.test(Did you forget to specify a revision?,
commit: say ‘hello world’,
{$t.our-nick}, Seems like you forgot to specify a revision (will use “v6.c” instead of “say”),
/^ $($t.our-nick) ‘, ¦v6.c (’\d+‘ commits): «hello world»’ $/,
/^ $($t.our-nick) ‘, ¦v6.c (’\d+‘ commits): «hello world»’ $/,
:20timeout);

# Timeouts
Expand Down

0 comments on commit a06d59d

Please sign in to comment.