Skip to content

Commit

Permalink
[test] add testcase for double-quoted lex names GH #1095
Browse files Browse the repository at this point in the history
in perl6 the correctly double-quoted .lex "foo\\o", $P3 name fails to work.
see https://rt.perl.org/Public/Bug/Display.html?id=116643
this might be caused by the switch from globals to lexicals, as this statement
is now enclosed in a block.

in parrot the binary character \0 causes problems in lexnames with roundtrips.
  • Loading branch information
Reini Urban committed Oct 15, 2014
1 parent 786869f commit 8766340
Showing 1 changed file with 29 additions and 2 deletions.
31 changes: 29 additions & 2 deletions t/compilers/imcc/syn/clash.t
@@ -1,13 +1,13 @@
#!perl
# Copyright (C) 2001-2014, Parrot Foundation.
# Copyright (C) 2001-2009,2014, Parrot Foundation.

use strict;
use warnings;
use lib qw( . lib ../lib ../../lib );

use Test::More;
use Parrot::Config;
use Parrot::Test tests => 13;
use Parrot::Test tests => 14;

pir_output_is( <<'CODE', <<'OUT', "if/unless" );
.sub test :main
Expand Down Expand Up @@ -232,6 +232,33 @@ CODE
/Multiple declarations of lexical 'foo'/
OUT

# perl6 has a similar issue but there testcase 2 failed. RT #116643
pir_output_is( <<'CODE', <<'OUT', 'double-quoted .lex names', todo => 'GH #1095');
.sub 'main' :main
.lex 'bar\o', $P0
$P1 = box 'ok 1'
store_lex 'bar\o', $P1
$P2 = find_lex 'bar\o'
say $P2
.lex "foo\\o", $P3
$P1 = box 'ok 2'
store_lex "foo\\o", $P1
$P2 = find_lex "foo\\o"
say $P2
.lex "foo\o", $P4
$P1 = box 'ok 3'
store_lex "foo\o", $P1
$P2 = find_lex "foo\o"
say $P2
.end
CODE
ok 1
ok 2
ok 3
OUT

# Local Variables:
# mode: cperl
# cperl-indent-level: 4
Expand Down

0 comments on commit 8766340

Please sign in to comment.