diff options
author | Nick Ing-Simmons <nik@tiuk.ti.com> | 2003-05-02 13:37:08 +0000 |
---|---|---|
committer | Nick Ing-Simmons <nik@tiuk.ti.com> | 2003-05-02 13:37:08 +0000 |
commit | 2b881ee74bf7aab1bea94d803004757f3ae0c571 (patch) | |
tree | c07a2de4a22a6116970a638b3d6ae5478d62db6b /t | |
parent | 7777929a1344ae3adddfcf7a297005c278038c36 (diff) | |
parent | d7aa4417de5aebb1d2374018c62148692ef32d8b (diff) | |
download | perl-2b881ee74bf7aab1bea94d803004757f3ae0c571.tar.gz |
Integrate mainline (run/switchd.t fails).
p4raw-id: //depot/perlio@19379
Diffstat (limited to 't')
-rw-r--r-- | t/comp/parser.t | 5 | ||||
-rw-r--r-- | t/io/layers.t | 5 | ||||
-rwxr-xr-x | t/op/taint.t | 10 | ||||
-rw-r--r-- | t/run/switchd.t | 40 |
4 files changed, 54 insertions, 6 deletions
diff --git a/t/comp/parser.t b/t/comp/parser.t index b50d8af29d..25025cc06c 100644 --- a/t/comp/parser.t +++ b/t/comp/parser.t @@ -9,7 +9,7 @@ BEGIN { } require "./test.pl"; -plan( tests => 37 ); +plan( tests => 38 ); eval '%@x=0;'; like( $@, qr/^Can't modify hash dereference in repeat \(x\)/, '%@x=0' ); @@ -89,6 +89,9 @@ ${a}{ ${a}[ @{b}{ ${a}{ } +eval q{ sub a(;; &) { } a { } }; +is($@, '', "';&' sub prototype confuses the lexer"); + # Bug #21575 # ensure that the second print statement works, by playing a bit # with the test output. diff --git a/t/io/layers.t b/t/io/layers.t index 8f70392434..3060da5750 100644 --- a/t/io/layers.t +++ b/t/io/layers.t @@ -10,6 +10,11 @@ BEGIN { print "1..0 # Skip: not perlio\n"; exit 0; } + eval 'use Encode'; + if ($@ =~ /dynamic loading not available/) { + print "1..0 # miniperl cannot load Encode\n"; + exit 0; + } # Makes testing easier. $ENV{PERLIO} = 'stdio' if exists $ENV{PERLIO} && $ENV{PERLIO} eq ''; if (exists $ENV{PERLIO} && $ENV{PERLIO} !~ /^(stdio|perlio|mmap)$/) { diff --git a/t/op/taint.t b/t/op/taint.t index 846e1fd8fd..e6e1265466 100755 --- a/t/op/taint.t +++ b/t/op/taint.t @@ -44,7 +44,7 @@ BEGIN { eval { require IPC::SysV }; unless ($@) { $ipcsysv++; - IPC::SysV->import(qw(IPC_PRIVATE IPC_RMID IPC_CREAT S_IRWXU)); + IPC::SysV->import(qw(IPC_PRIVATE IPC_RMID IPC_CREAT S_IRWXU IPC_NOWAIT)); } } } @@ -700,14 +700,14 @@ else { my $type_rcvd; if (defined $id) { - if (msgsnd($id, pack("l! a*", $type_sent, $sent), 0)) { - if (msgrcv($id, $rcvd, 60, 0, 0)) { + if (msgsnd($id, pack("l! a*", $type_sent, $sent), IPC_NOWAIT)) { + if (msgrcv($id, $rcvd, 60, 0, IPC_NOWAIT)) { ($type_rcvd, $rcvd) = unpack("l! a*", $rcvd); } else { - warn "# msgrcv failed\n"; + warn "# msgrcv failed: $!\n"; } } else { - warn "# msgsnd failed\n"; + warn "# msgsnd failed: $!\n"; } msgctl($id, IPC_RMID, 0) or warn "# msgctl failed: $!\n"; } else { diff --git a/t/run/switchd.t b/t/run/switchd.t new file mode 100644 index 0000000000..83d4976b71 --- /dev/null +++ b/t/run/switchd.t @@ -0,0 +1,40 @@ +#!./perl -w + +BEGIN { + chdir 't' if -d 't'; + @INC = qw(../lib lib); +} + +require "./test.pl"; + +plan(tests => 1); + +my $r; +my @tmpfiles = (); +END { unlink @tmpfiles } + +my $filename = 'swdtest.tmp'; +SKIP: { + open my $f, ">$filename" + or skip( "Can't write temp file $filename: $!" ); + print $f <<'__SWDTEST__'; +package Bar; +sub bar { $_[0] * $_[0] } +package Foo; +sub foo { + my $s; + $s += Bar::bar($_) for 1..$_[0]; +} +package main; +Foo::foo(3); +__SWDTEST__ + close $f; + push @tmpfiles, $filename; + $| = 1; # Unbufferize. + $r = runperl( + switches => [ '-Ilib', '-d:DevelTest' ], + progfile => $filename, + ); + like($r, qr/^main,swdtest.tmp,9;Foo,swdtest.tmp,5;Foo,swdtest.tmp,6;Foo,swdtest.tmp,6;Bar,swdtest.tmp,2;Foo,swdtest.tmp,6;Bar,swdtest.tmp,2;Foo,swdtest.tmp,6;Bar,swdtest.tmp,2;Foo,swdtest.tmp,6;$/i); +} + |