From: Nicholas Clark Date: Sun, 24 Oct 2010 12:07:26 +0000 (+0200) Subject: Tests for B::cchar(). X-Git-Tag: accepted/trunk/20130322.191538~7196 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=01c3a48515f35a9a4fccaee79fafa1c4d6165b08;p=platform%2Fupstream%2Fperl.git Tests for B::cchar(). --- diff --git a/ext/B/t/b.t b/ext/B/t/b.t index a9fdbd6..b32ce31 100644 --- a/ext/B/t/b.t +++ b/ext/B/t/b.t @@ -183,6 +183,16 @@ like(B::hash("wibble"), qr/0x[0-9a-f]*/, "Testing B::hash()"); is(B::perlstring($test), $expect, "B::perlstring($expect) (Unicode)"); } } +{ + my @tests = (map {eval(qq{"$_"}), $_} '\\n', '\\r', '\\t', + '\\b', '\\a', '\\f', '\\000', '\\\'', '?'), '"', '"', + ord 'N' == 78 ? (chr 11, q{'\013"'}, "\177", "'\\177'") : (); + + while (my ($test, $expect) = splice @tests, 0, 2) { + is(B::cchar($test), "'${expect}'", "B::cchar(qq{$expect})"); + } +} + is(B::class(bless {}, "Wibble::Bibble"), "Bibble", "Testing B::class()"); is(B::cast_I32(3.14), 3, "Testing B::cast_I32()"); is(B::opnumber("chop"), 38, "Testing opnumber with opname (chop)");