This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Convert to DebugWrap.
authorShlomi Fish <shlomif@shlomifish.org>
Thu, 13 Sep 2012 11:32:41 +0000 (14:32 +0300)
committerRicardo Signes <rjbs@cpan.org>
Mon, 12 Nov 2012 14:18:22 +0000 (09:18 -0500)
lib/perl5db.t

index 89a3f28..e538c61 100644 (file)
@@ -109,16 +109,6 @@ sub afterinit {
 EOF
 }
 
-# taint tests
-
-{
-    local $ENV{PERLDB_OPTS} = "ReadLine=0 NonStop=1";
-    my $output = runperl(switches => [ '-d', '-T' ], stderr => 1,
-        progfile => '../lib/perl5db/t/taint');
-    chomp $output if $^O eq 'VMS'; # newline guaranteed at EOF
-    is($output, '[$^X][done]', "taint");
-}
-
 package DebugWrap;
 
 sub new {
@@ -306,6 +296,11 @@ sub _run {
     return;
 }
 
+sub get_output
+{
+    return shift->_output();
+}
+
 sub output_like {
     my ($self, $re, $msg) = @_;
 
@@ -510,6 +505,21 @@ sub _calc_foo_wrapper
     $wrapper->contents_unlike(qr/baz/, "[perl #104168] - no 'baz'");
 }
 
+# taint tests
+{
+    my $wrapper = _calc_foo_wrapper(
+        {
+            prog => '../lib/perl5db/t/taint',
+            extra_opts => ' NonStop=1',
+            switches => [ '-d', '-T', ],
+        }
+    );
+
+    my $output = $wrapper->get_output();
+    chomp $output if $^O eq 'VMS'; # newline guaranteed at EOF
+    is($output, '[$^X][done]', "taint");
+}
+
 # Testing that we can set a line in the middle of the file.
 {
     my $wrapper = DebugWrap->new(