Unnecessary downgrades.
[p5sagit/p5-mst-13.2.git] / ext / B / Showlex.t
CommitLineData
87a42246 1#!./perl
2
3BEGIN {
4 if ($^O eq 'MacOS') {
5 @INC = qw(: ::lib ::macos:lib);
6 }
7}
8
9$| = 1;
10use warnings;
11use strict;
12use Config;
13
14print "1..1\n";
15
16my $test = 1;
17
18sub ok { print "ok $test\n"; $test++ }
19
20my $a;
21my $Is_VMS = $^O eq 'VMS';
22my $Is_MacOS = $^O eq 'MacOS';
23
24my $path = join " ", map { qq["-I$_"] } @INC;
d0c1fe9a 25$path = '"-I../lib" "-Iperl_root:[lib]"' if $Is_VMS; # gets too long otherwise
87a42246 26my $redir = $Is_MacOS ? "" : "2>&1";
27my $is_thread = $Config{use5005threads} && $Config{use5005threads} eq 'define';
28
29if ($is_thread) {
30 print "# use5005threads: test $test skipped\n";
31} else {
32 $a = `$^X $path "-MO=Showlex" -e "my %one" $redir`;
33 if (ord('A') != 193) { # ASCIIish
34 print "# [$a]\nnot " unless $a =~ /sv_undef.*PVNV.*%one.*sv_undef.*HV/s;
35 }
36 else { # EBCDICish C<1: PVNV (0x1a7ede34) "%\226\225\205">
37 print "# [$a]\nnot " unless $a =~ /sv_undef.*PVNV.*%\\[0-9].*sv_undef.*HV/s;
38 }
39}
40ok;