After building Parrot without ICU, 01-regex.t test 118 fails as
follows:

        t/compilers/pge/p6regex/01-regex.........
        #     Failed test (t/compilers/pge/p6regex/01-regex.t at line 59)
        #          got: 'no ICU lib loaded
        # current instr.: 'parrot;PGE::Grammar;_regex_corou' pc 118 (EVAL_1:51)
        # called from Sub 'parrot;PGE::Grammar;_regex' pc 20 (EVAL_1:8)
        # called from Sub '_PGE_Test' pc 34 
(/usr/src/parrot/t/compilers/pge/p6regex/01-regex_118.pir:18)
        # '
        #     expected: 'matched'
        # './parrot  --gc-debug  
"/usr/src/parrot/t/compilers/pge/p6regex/01-regex_118.pir"' failed with exit 
code 1
        # Looks like you failed 1 test of 494.

The attached patch seems to take care of this.  Is this a reasonable way
to do it?

                                        -- Bob Rogers
                                           http://rgrjr.dyndns.org/

Index: t/compilers/pge/p6regex/01-regex.t
===================================================================
--- t/compilers/pge/p6regex/01-regex.t  (revision 13443)
+++ t/compilers/pge/p6regex/01-regex.t  (working copy)
@@ -7,6 +7,7 @@
 use Test::More;
 use Parrot::Test tests => 494;
 use Parrot::Test::PGE;
+use Parrot::Config;
 
 =head1 NAME
 
@@ -54,7 +55,16 @@
     $target =~ s/\\x(..)/chr(hex($1))/eg;
 
     my @todo = ();
-    if ($description =~ m{TODO:}) { @todo = ('todo' => $description); }
+    if ($description =~ m{TODO:}) {
+       @todo = ('todo' => $description);
+    }
+    elsif ($description =~ m{ICU:} 
+          && ! $PConfig{has_icu}) {
+      SKIP: {
+         skip("no $description", 1);
+       }
+       next;
+    }
 
     if ($result =~ m{^/(.*)/$}) {
         p6rule_like($target, $pattern, qr/$1/, $description, @todo);
Index: t/compilers/pge/p6regex/regex_tests
===================================================================
--- t/compilers/pge/p6regex/regex_tests (revision 13443)
+++ t/compilers/pge/p6regex/regex_tests (working copy)
@@ -118,7 +118,7 @@
 ^ \v+ $                        \u000a\u000b\u000c\u000d\u0085  y       0-255 
vertical whitespace (\v)
 ^ \h+ $                        \u000a\u000b\u000c\u000d\u0085  n       0-255 
horizontal whitespace (\h)
 ^ \v+ $                        \u0009\u0020\u00a0      n       0-255 vertical 
whitespace (\v)
-^ \s+ $                        
\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2008\u2009\u200a\u202f\u205f\u3000\u000a\u000b\u000c\u000d\u0085
    y       unicode whitespace (\s)
+^ \s+ $                        
\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2008\u2009\u200a\u202f\u205f\u3000\u000a\u000b\u000c\u000d\u0085
    y       ICU: unicode whitespace (\s)
 ^ \h+ $                        
\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2008\u2009\u200a\u202f\u205f\u3000
  y       unicode whitespace (\h)
 ^ \v+ $                        \u000a\u000b\u000c\u000d\u0085  y       unicode 
whitespace (\v)
 ^ \h+ $                        \u000a\u000b\u000c\u000d\u0085  n       unicode 
whitespace (\h)

Reply via email to