develooper Front page | perl.perl5.porters | Postings from November 2000

tests skipped: unknown reason

Thread Next
From:
Lupe Christoph
Date:
November 10, 2000 00:03
Subject:
tests skipped: unknown reason
Message ID:
20001110084938.I785@alanya.lupe-christoph.de
Hello, test writers!

When I ran "cd t; ./perl harness"as recommended by Nick Ing-Simmons,
My eye caught these:

op/regexp...........ok, 3/777 skipped: unknown reason                        
op/regexp_noamp.....ok, 7/777 skipped: unknown reason                        

These tests are either skipped because of a 'B' or 'b' flags
in t/op/re_tests or because we are UTF-8 shy ;-)

I believe it would be useful to document the reason for the {Bb]
flag in re_tests and print that along with the 'skipped', lest
we forget why we inserted the flag, and print something like
"UTF-8 regexp problem" with the others.

These are the tests that get skipped because of the flag:
 540: 'a\Z'm    a\nb\n  bn      -       -
 558: 'aa\Z'm   aa\nb\n bn      -       -
 612: 'ab\Z'm   ab\nb\n bn      -       -
 666: 'abb\Z'm  abb\nb\n        bn      -       -

Note that there is currently no 'B' in effect.

These are the tests skipped for UTF-8 reasons:

 495: ([[:^alnum:]]+) ABcd01Xy__--  ${nulnul}${ffff}  y       $1      __--  ${nulnul}${ffff}
 500: ([[:^print:]]+) ABcd01Xy__--  ${nulnul}${ffff}  y       $1      ${nulnul}${ffff}
 503: ([[:^word:]]+)  ABcd01Xy__--  ${nulnul}${ffff}  y       $1      --  ${nulnul}${ffff}

Here is a patch to regexp.t; I can't patch re_tests...

*** op/regexp.t.orig	Tue Aug 29 14:54:13 2000
--- op/regexp.t	Fri Nov 10 08:47:14 2000
***************
*** 26,31 ****
--- 26,34 ----
  # Column 5 contains the expected result of double-quote
  # interpolating that string after the match, or start of error message.
  #
+ # Column 6, if present, contains a reason why the test is skipped.
+ # This is printed with "skipped", for harness to pick up.
+ #
  # \n in the tests are interpolated, as are variables of the form ${\w+}.
  #
  # If you want to add a regular expression test that can't be expressed
***************
*** 56,62 ****
  while (<TESTS>) {
      chomp;
      s/\\n/\n/g;
!     ($pat, $subject, $result, $repl, $expect) = split(/\t/,$_);
      $input = join(':',$pat,$subject,$result,$repl,$expect);
      infty_subst(\$pat);
      infty_subst(\$expect);
--- 59,66 ----
  while (<TESTS>) {
      chomp;
      s/\\n/\n/g;
!     ($pat, $subject, $result, $repl, $expect, @reason) = split(/\t/,$_);
!     $reason = join(' ', @reason);
      $input = join(':',$pat,$subject,$result,$repl,$expect);
      infty_subst(\$pat);
      infty_subst(\$expect);
***************
*** 70,76 ****
      $expect = $repl = '-' if $skip_amp and $input =~ /\$[&\`\']/;
      $skip = ($skip_amp ? ($result =~ s/B//i) : ($result =~ s/B//));
      # Certain tests don't work with utf8 (the re_test should be in UTF8)
!     $skip = 1 if ($^H &= ~0x00000008) && $pat =~ /\[:\^(alnum|print|word):\]/;
      $result =~ s/B//i unless $skip;
      for $study ('', 'study \$subject') {
   	$c = $iters;
--- 74,81 ----
      $expect = $repl = '-' if $skip_amp and $input =~ /\$[&\`\']/;
      $skip = ($skip_amp ? ($result =~ s/B//i) : ($result =~ s/B//));
      # Certain tests don't work with utf8 (the re_test should be in UTF8)
!     $skip = 1, $reason = 'utf8'
!       if ($^H &= ~0x00000008) && $pat =~ /\[:\^(alnum|print|word):\]/;
      $result =~ s/B//i unless $skip;
      for $study ('', 'study \$subject') {
   	$c = $iters;
***************
*** 81,87 ****
  	    last;  # no need to study a syntax error
  	}
  	elsif ( $skip ) {
! 	    print "ok $. # skipped\n"; next TEST;
  	}
  	elsif ($@) {
  	    print "not ok $. $input => error `$err'\n"; next TEST;
--- 86,93 ----
  	    last;  # no need to study a syntax error
  	}
  	elsif ( $skip ) {
! 	    print "ok $. # skipped", length($reason) ? " $reason" : '', "\n";
! 	    next TEST;
  	}
  	elsif ($@) {
  	    print "not ok $. $input => error `$err'\n"; next TEST;

Lupe Christoph
-- 
| lupe@lupe-christoph.de       |        http://free.prohosting.com/~lupe |
| "jryy vg ybbxf yvxr gur l2x oht qvqa'g erne vg'f htyl urnq." "lrc. gur |
| qbbzfnlref unir orra cebira jebat lrg ntnva."  ....  "qvq lbh frr gung |
| gbb?" "ubhfgba. jr unir n ceboyrz."           User Friendly 2000-01-01 |

Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About