nayakgi / perl-compiler

Automatically exported from code.google.com/p/perl-compiler
Other
0 stars 0 forks source link

t/CORE/test.pl is() mishandles some arguments sometimes #253

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?

1. perl

Problem 1:

   perl -e 'INIT { require "t/CORE/test.pl"}plan(tests=>2);is(v42,"*");is("*", v42);' # N is in ascii range, 1st arg

   perl -e 'INIT { require "t/CORE/test.pl"}plan(tests=>2);is(v200,"\xc8");is("\xc8", v200);' # N is in extended ascii range, 1st arg

   perl -e 'INIT { require "t/CORE/test.pl"}plan(tests=>2);is(v9829,"\x{2665}");is("\x{2665}", v9829);' # N is beyond ascii range, 1st arg

Problem 2:

   perl -e 'INIT { require "t/CORE/test.pl"}plan(tests=>2);is("*", v42);is(v42,"*");' # N is in ascii range, 2nd arg

   perl -e 'INIT { require "t/CORE/test.pl"}plan(tests=>2);is("\xc8", v200);is(v200,"\xc8");' # N is in extended ascii range, 2nd arg

   perl -e 'INIT { require "t/CORE/test.pl"}plan(tests=>2);is("\x{2665}", v9829);is(v9829,"\x{2665}");' # N is beyond ascii range, 2nd arg

2. compiled:

Problem 1:

   perlcc -O3 -r -e 'INIT { require "t/CORE/test.pl"}plan(tests=>2);is(v42,"*");is("*", v42);' # N is in ascii range, 1st arg

   perlcc -O3 -r -e 'INIT { require "t/CORE/test.pl"}plan(tests=>2);is(v200,"\xc8");is("\xc8", v200);' # N is in extended ascii range, 1st arg

   perlcc -O3 -r -e 'INIT { require "t/CORE/test.pl"}plan(tests=>2);is(v9829,"\x{2665}");is("\x{2665}", v9829);' # N is beyond ascii range, 1st arg

Problem 2:

   perlcc -O3 -r -e 'INIT { require "t/CORE/test.pl"}plan(tests=>2);is("*", v42);is(v42,"*");' # N is in ascii range, 2nd arg

   perlcc -O3 -r -e 'INIT { require "t/CORE/test.pl"}plan(tests=>2);is("\xc8", v200);is(v200,"\xc8");' # N is in extended ascii range, 2nd arg

   perlcc -O3 -r -e 'INIT { require "t/CORE/test.pl"}plan(tests=>2);is("\x{2665}", v9829);is(v9829,"\x{2665}");' # N is beyond ascii range, 2nd arg

> What is the expected output?

Problem 1: all tests should pass when compiled like they do under uncompiled 
perl
Problem 2: all tests should pass when compiled like they do under uncompiled 
perl

> What do you see instead?

Problem 1: the “N is in extended ascii range” fails both tests since is() 
sees the arg "\xc8" (and the equiv \x{c8} FTM) is seen as \xc3
Problem 2: the “N is in extended ascii range” fails both tests since is() 
sees the v (and +v FTM) values as nulls

> Please use labels and text to provide additional information.

Determined via t/CORE/op/ver.t failures of tests 28, 29, 36, 38, and 39 (37 
passes since bother are the same broken value)

perl 5.14.4

CenOS 6.4 32 bit

Original issue reported on code.google.com by cpanel...@gmail.com on 3 Dec 2013 at 4:26

GoogleCodeExporter commented 9 years ago
Fixed with #245, 1.42_70 commit 689c3e9

t/C-COMPILED/CORE--op--ver==BADTEST-253.t          (Wstat: 0 Tests: 13 Failed: 
0)
  TODO passed:   10-11

Original comment by reini.urban on 13 Jan 2014 at 6:57