From fdc18556701202efb38dee6dab4d8aff8b7d00eb Mon Sep 17 00:00:00 2001 From: Father Chrysostomos Date: Tue, 27 Aug 2013 13:20:39 -0700 Subject: [PATCH] Test line breaks in PERL5DB MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit $ PERL5DB='sub DB::DB{} die' perl5.18.1 -dle 'print "ok"' Died. $ PERL5DB='sub DB::DB{} die' perl5.18.1 -dle 'print "ok"' ok So everything after the line break is ignored. In bleadperl: $ PERL5DB='sub DB::DB{} die' ./perl -dle 'print "ok"' Died. $ PERL5DB='sub DB::DB{} die' ./perl -dle 'print "ok"' Died at -e line 1. Now the whole environment variable is used. This was probably changed by commit 2179133. Let’s call it a bug fix and test it. (The ‘at -e line 1’ is not right, but the next commit will fix it.) --- t/run/switchd.t | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/t/run/switchd.t b/t/run/switchd.t index f160fd5..98acba4 100644 --- a/t/run/switchd.t +++ b/t/run/switchd.t @@ -9,7 +9,7 @@ BEGIN { require "./test.pl"; } # This test depends on t/lib/Devel/switchd*.pm. -plan(tests => 11); +plan(tests => 12); my $r; @@ -174,3 +174,17 @@ like( # miniperl tacks a BEGIN block on to the same line 'Copy on write does not mangle ${"_<-e"}[0] [perl #118627]', ); + +# PERL5DB with embedded newlines +{ + local $ENV{PERL5DB} = "sub DB::DB{}\ndie"; + like( + runperl( + switches => [ '-Ilib', '-ld' ], + prog => 'print qq|not ok|', + stderr => 1 + ), + qr /Died/, + 'PERL5DB with embedded newlines', + ); +} -- 2.7.4