X-Git-Url: https://perl5.git.perl.org/perl5.git/blobdiff_plain/89bfd824260d1b31d8f48e0c38e8ad89bf285b4b..75219bacf5aacd315b96083de24e82cd8238e99a:/t/op/lex.t diff --git a/t/op/lex.t b/t/op/lex.t index c0f94c0..e50f0eb 100644 --- a/t/op/lex.t +++ b/t/op/lex.t @@ -7,7 +7,7 @@ use warnings; BEGIN { chdir 't' if -d 't'; require './test.pl'; } -plan(tests => 27); +plan(tests => 34); { no warnings 'deprecated'; @@ -129,7 +129,7 @@ fresh_perl_is( '* ident' ); SKIP: { - skip "Different output on EBCDIC (presumably)", 2 if $::IS_EBCDIC; + skip "Different output on EBCDIC (presumably)", 3 if $::IS_EBCDIC; fresh_perl_is( qq'"ab}"ax;&\0z\x8Ao}\x82x;', < 1 }, 'gibberish containing &{+z} - used to crash [perl #123753]' ); + fresh_perl_is( + "\@{\327\n", <<\gibberisi, +Unrecognized character \xD7; marked by <-- HERE after @{<-- HERE near column 3 at - line 1. +gibberisi + { stderr => 1 }, + '@ { \327 \n - used to garble output (or fail asan) [perl #128951]' + ); } fresh_perl_is( @@ -220,3 +227,49 @@ fresh_perl_is( like runperl(prog => 'sub ub(){0} ub ub', stderr=>1), qr/Bareword found/, '[perl #126482] Assert failure when mentioning a constant twice in a row'; + +fresh_perl_is( + "do\0"."000000", + "", + {}, + '[perl #129069] - no output and valgrind clean' +); + +fresh_perl_is( + "00my sub\0", + "Missing name in \"my sub\" at - line 1.\n", + {}, + '[perl #129069] - "Missing name" warning and valgrind clean' +); + +fresh_perl_like( + "#!perl -i u\nprint 'OK'", + qr/OK/, + {}, + '[perl #129336] - #!perl -i argument handling' +); +SKIP: +{ + ord("A") == 65 + or skip "These tests won't work on EBCIDIC", 3; + fresh_perl_is( + "BEGIN{\$^H=hex ~0}\xF3", + "Integer overflow in hexadecimal number at - line 1.\n" + . "Malformed UTF-8 character: \\xf3 (too short; 1 byte available, need 4) at - line 1.\n" + . "Malformed UTF-8 character (fatal) at - line 1.", + {}, + '[perl #128996] - use of PL_op after op is freed' + ); + fresh_perl_like( + qq(BEGIN{\$0="";\$^H=-hex join""=>1}""\xFF), + qr/Malformed UTF-8 character: \\xff \(too short; 1 byte available, need 13\) at - line 1\./, + {}, + '[perl #128997] - buffer read overflow' + ); + fresh_perl_like( + qq(BEGIN{\$^H=0x800000}\n 0m 0\xB5\xB500\xB5\0), + qr/Malformed UTF-8 character: \\xb5 \(unexpected continuation byte 0xb5, with no preceding start byte\)/, + {}, + '[perl #129000] read before buffer' + ); +}