This is an automatically generated mail to inform you that tests are now 
available in t/spec/integration/advent2009-day08.t

commit d08a89fab130927bdcfe51906a9daf77a23a4fac
Author: snarkyboojum <snarkyboo...@c213334d-75ef-0310-aa23-eaa082d1ae64>
Date:   Wed May 19 13:56:36 2010 +0000

    [t/spec] Added initial tests for Perl 6 Advent Calendar Day 8: .comb your 
constraints
    
    git-svn-id: http://svn.pugscode.org/p...@30714 
c213334d-75ef-0310-aa23-eaa082d1ae64

diff --git a/t/spec/integration/advent2009-day08.t 
b/t/spec/integration/advent2009-day08.t
index 3b8390f..575400c 100644
--- a/t/spec/integration/advent2009-day08.t
+++ b/t/spec/integration/advent2009-day08.t
@@ -2,3 +2,16 @@
 
 use v6;
 use Test;
+
+plan 6;
+
+multi sub very_odd(Int $odd where {$odd % 2}) { Bool::True }
+multi sub very_odd(Int $odd) { Bool::False }
+
+ok very_odd(1), 'Type constraint - odd number';
+nok very_odd(2), 'Type constraint - even number';
+
+is "Perl 6 Advent".comb(/<alpha>/).join('|'), 'P|e|r|l|A|d|v|e|n|t', 'Comb for 
<alpha> and join on |';
+is "Perl 6 Advent".comb(/<alpha>+/).join('|'), 'Perl|Advent', 'Comb for 
<alpha>+ and join on |';
+is "5065726C36".comb(/<xdigit>**2/)».fmt("0x%s")».chr.join, 'Perl6', 'Comb 
ASCII hex chars with hyperop to convert to ASCII equivalent';
+is ("5065726C36".comb(/<xdigit>**2/).map: { chr "0x" ~ $_ }).join, 'Perl6', 
'Comb ASCII hex chars using map to convert to ASCII equivalent';

Reply via email to