From 574fde551fdfac289d149541a993a1583cb6c618 Mon Sep 17 00:00:00 2001 From: Nicholas Clark Date: Mon, 25 Oct 2010 08:46:53 +0100 Subject: [PATCH] Correct tests for B::{cstring,perlstring,cchar} Fix a Perl precedence error that prevented several test cases for cchar() from being run. As a result, fix those test cases. Fix an ASCII assumption in the tests common to cstring() and perlstring(). (chr 127 is " on EBCDIC, which is most definitely printable, so won't be replaced with octal there.) --- ext/B/t/b.t | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/ext/B/t/b.t b/ext/B/t/b.t index 5bd4d18..614c8b2 100644 --- a/ext/B/t/b.t +++ b/ext/B/t/b.t @@ -178,8 +178,8 @@ is(B::opnumber("pp_null"), 0, "Testing opnumber with opname (pp_null)"); is(B::perlstring(undef), '0', "Testing B::perlstring(undef)"); my @common = map {eval $_, $_} - '"wibble"', '"\""', '"\'"', '"\\\\"', '"\\n\\r\\t\\b\\a\\f"', '"\\177"', - '"\000"', '"\000\000"', '"\000Bing\000"'; + '"wibble"', '"\""', '"\'"', '"\\\\"', '"\\n\\r\\t\\b\\a\\f"', '"\000"', + '"\000\000"', '"\000Bing\000"', ord 'N' == 78 ? '"\\177"' : (); my $oct = sprintf "\\%03o", ord '?'; my @tests = (@common, '$_', '"$_"', '@_', '"@_"', '??N', qq{"$oct?N"}, @@ -200,9 +200,9 @@ is(B::opnumber("pp_null"), 0, "Testing opnumber with opname (pp_null)"); } } { - my @tests = (map {eval(qq{"$_"}), $_} '\\n', '\\r', '\\t', - '\\b', '\\a', '\\f', '\\000', '\\\'', '?'), '"', '"', - ord 'N' == 78 ? (chr 11, q{'\013"'}, "\177", "'\\177'") : (); + my @tests = ((map {eval(qq{"$_"}), $_} '\\n', '\\r', '\\t', + '\\b', '\\a', '\\f', '\\000', '\\\'', '?'), '"', '"', + ord 'N' == 78 ? (chr 11, '\v', "\177", '\\177') : ()); while (my ($test, $expect) = splice @tests, 0, 2) { is(B::cchar($test), "'${expect}'", "B::cchar(qq{$expect})"); -- 2.7.4