Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Make a test robust in the face of NFG.
It had a hash of opener/closer pairs. However, in an implementation
that does NFG, due to singleton decompositions in Unicode, two of the
opener/closer pairs ended up equal after normalization, resulting in a
hash with an element less and thus a test less being run. Use a list
of pairs instead.
  • Loading branch information
jnthn committed Apr 24, 2015
1 parent d62cc3d commit 1272df2
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions S02-literals/quoting-unicode.t
Expand Up @@ -44,7 +44,7 @@ RIGHT SQUARE BRACKET WITH TICK IN BOTTOM CORNER(U+298D/U+298E)';
}

{
my %ps_pe = (
my @ps_pe = (
'(' => ')', '[' => ']', '{' => '}', '' => '', '' => '',
'' => '', '' => '', '' => '', '' => '', '' => '',
'' => '', '' => '', '' => '', '' => '', '' => '',
Expand All @@ -60,10 +60,10 @@ RIGHT SQUARE BRACKET WITH TICK IN BOTTOM CORNER(U+298D/U+298E)';
'' => '', '' => '', '' => '', '' => '',
'' => '', '' => '', '' => '', '' => '',
);
for keys %ps_pe {
next if $_ eq '('; # skip '(' => ')' because q() is a sub call
my $string = 'q' ~ $_ ~ 'abc' ~ %ps_pe{$_};
is EVAL($string), 'abc', $string ~ sprintf(' (U+%X/U+%X)',$_.ord,%ps_pe{$_}.ord);
for @ps_pe {
next if .key eq '('; # skip '(' => ')' because q() is a sub call
my $string = 'q' ~ .key ~ 'abc' ~ .value;
is EVAL($string), 'abc', $string ~ sprintf(' (U+%X/U+%X)',.key.ord,.value.ord);
}
}

Expand Down

0 comments on commit 1272df2

Please sign in to comment.