This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
[perl #116190] use the true and trusted fresh_perl_is()
authorTony Cook <tony@develop-help.com>
Tue, 16 Jul 2013 02:00:41 +0000 (12:00 +1000)
committerTony Cook <tony@develop-help.com>
Tue, 23 Jul 2013 00:02:26 +0000 (10:02 +1000)
instead of re-inventing it yet again

t/run/switchF2.t

index 51136d2..5e99e1e 100644 (file)
@@ -7,9 +7,10 @@ BEGIN {
 }
 plan(tests => 1);
 
-my $cmd = "echo 1 | ./perl -n -F: -e print+\\\@F";
-my $got = `$cmd` || '';
-my $ok = 0 == $?;
-chomp $got;
-ok( ($ok and $got eq 1),
-  "passing -F implies -a" );
+{ # perl #116190
+  fresh_perl_is('print qq!@F!', '1 2',
+               {
+                stdin => "1:2",
+                switches => [ '-n', '-F:' ],
+               }, "passing -F implies -a");
+}