print "1..0 # Skip -- Perl configured without B module\n";
exit 0;
}
- unless ($Config::Config{useperlio}) {
- print "1..0 # Skip -- Perl configured without perlio\n";
- exit 0;
- }
}
use Carp;
######## API tests v.60
-use Config; # used for perlio check
B::Concise->import(qw( set_style set_style_standard add_callback
add_style walk_output reset_sequence ));
is ($@, '', "walk_output() accepts obj that can print");
# test that walk_output accepts a HANDLE arg
-SKIP: {
- skip("no perlio in this build", 4)
- unless $Config::Config{useperlio};
-
+{
foreach my $foo (\*STDOUT, \*STDERR) {
eval { walk_output($foo) };
is ($@, '', "walk_output() accepts STD* " . ref $foo);
return $out;
}
-SKIP: {
+{
# tests output to GLOB, using perlio feature directly
- skip "no perlio on this build", 127
- unless $Config::Config{useperlio};
-
set_style_standard('concise'); # MUST CALL before output needed
@options = qw(
SKIP: {
skip "Data::Dumper is statically linked", 1
- if $Config{static_ext} =~ m|\bData/Dumper\b|;
+ if $Config::Config{static_ext} =~ m|\bData/Dumper\b|;
like($out, qr/FUNC: \*Data::Dumper::format_refaddr/,
"stash rendering loads package as needed");
}
print "1..0 # Skip -- Perl configured without B module\n";
exit 0;
}
- if (!$Config::Config{useperlio}) {
- print "1..0 # Skip -- need perlio to walk the optree\n";
- exit 0;
- }
}
use OptreeCheck;
plan tests => 18;
Code test snippets here are adapted from `perldoc -f map`
-Due to a bleadperl optimization (Dave Mitchell, circa may 04), the
-(map|grep)(start|while) opcodes have different flags in 5.9, their
-private flags /1, /2 are gone in blead (for the cases covered)
-
-When the optree stuff was integrated into 5.8.6, these tests failed,
-and were todo'd. They're now done, by version-specific tweaking in
-mkCheckRex(), therefore the skip is removed too.
-
=for gentest
# chunk: #!perl
print "1..0 # Skip -- Perl configured without B module\n";
exit 0;
}
- if (!$Config::Config{useperlio}) {
- print "1..0 # Skip -- need perlio to walk the optree\n";
- exit 0;
- }
}
use OptreeCheck;
plan tests => 38;
Code test snippets here are adapted from `perldoc -f map`
-Due to a bleadperl optimization (Dave Mitchell, circa apr 04), the
-(map|grep)(start|while) opcodes have different flags in 5.9, their
-private flags /1, /2 are gone in blead (for the cases covered)
-
-When the optree stuff was integrated into 5.8.6, these tests failed,
-and were todo'd. They're now done, by version-specific tweaking in
-mkCheckRex(), therefore the skip is removed too.
-
=head1 Test Notes
# chunk: #!perl
}
use strict;
-use Config;
use File::Spec;
use File::Path;
@lines = get_lines( '-MO=-q,success,foo,bar' );
isnt( $lines[1], 'Compiling!', 'Output should not be printed with -q switch' );
-SKIP: {
- skip( '-q redirection does not work without PerlIO', 2)
- unless $Config{useperlio};
- is( $lines[1], "[Compiling!", '... but should be in $O::BEGIN_output' );
+is( $lines[1], "[Compiling!", '... but should be in $O::BEGIN_output' );
- @lines = get_lines( '-MO=-qq,success,foo,bar' );
- is( scalar @lines, 3, '-qq should suppress even the syntax OK message' );
-}
+@lines = get_lines( '-MO=-qq,success,foo,bar' );
+is( scalar @lines, 3, '-qq should suppress even the syntax OK message' );
@lines = get_lines( '-MO=success,fail' );
like( $lines[1], qr/fail at .eval/,
print "1..0 # Skip -- Perl configured without B module\n";
exit 0;
}
- if (!$Config::Config{useperlio}) {
- print "1..0 # Skip -- need perlio to walk the optree\n";
- exit 0;
- }
}
use OptreeCheck;
print "1..0 # Skip -- Perl configured without B module\n";
exit 0;
}
- if (!$Config::Config{useperlio}) {
- print "1..0 # Skip -- need perlio to walk the optree\n";
- exit 0;
- }
}
# import checkOptree(), and %gOpts (containing test state)
use OptreeCheck; # ALSO DOES @ARGV HANDLING !!!!!!
-use Config;
plan tests => 41;
print "1..0 # Skip -- Perl configured without B module\n";
exit 0;
}
- if (!$Config::Config{useperlio}) {
- print "1..0 # Skip -- need perlio to walk the optree\n";
- exit 0;
- }
}
use OptreeCheck; # ALSO DOES @ARGV HANDLING !!!!!!
-use Config;
plan tests => 99;
}
}
use OptreeCheck;
-use Config;
plan tests => 18;
-SKIP: {
-skip "no perlio in this build", 4 unless $Config::Config{useperlio};
-
# The regression this was testing is that the first aelemfast, derived
# from a lexical array, is supposed to be a BASEOP "<0>", while the
# second, from a global, is an SVOP "<$>" or a PADOP "<#>" depending
# 3 <$> gvsv(*1) s ->4
EONT_EONT
-} #skip
-
my $t = <<'EOT_EOT';
# 8 <@> leave[1 ref] vKP/REFC ->(end)
# 1 <0> enter v ->2
print "1..0 # Skip -- Perl configured without B module\n";
exit 0;
}
- if (!$Config::Config{useperlio}) {
- print "1..0 # Skip -- need perlio to walk the optree\n";
- exit 0;
- }
}
use OptreeCheck;
-use Config;
plan tests => 46;
pass("GENERAL OPTREE EXAMPLES");
print "1..0 # Skip -- Perl configured without B module\n";
exit 0;
}
- if (!$Config::Config{useperlio}) {
- print "1..0 # Skip -- need perlio to walk the optree\n";
- exit 0;
- }
}
use OptreeCheck;
-use Config;
plan tests => 21;
pass("SORT OPTIMIZATION");
# import checkOptree(), and %gOpts (containing test state)
use OptreeCheck; # ALSO DOES @ARGV HANDLING !!!!!!
-use Config;
plan tests => 15;
print "1..0 # Skip -- Perl configured without B module\n";
exit 0;
}
- if (!$Config::Config{useperlio}) {
- print "1..0 # Skip -- need perlio to walk the optree\n";
- exit 0;
- }
}
use OptreeCheck;
-use Config;
plan tests => 42;
pass("OPTIMIZER TESTS - VAR INITIALIZATION");
$| = 1;
use warnings;
use strict;
-use Config;
use B::Showlex ();
plan tests => 15;
print $out if $verbose;
-SKIP: {
- skip "no perlio in this build", 5
- unless $Config::Config{useperlio};
-
our $buf = 'arb startval';
my $ak = B::Showlex::walk_output (\$buf);
$walker->();
}
-}