1N/A# Tests for the command-line switches: 1N/A# -0, -c, -l, -s, -m, -M, -V, -v, -h, -z, -i 1N/A# Some switches have their own tests, see MANIFEST. 1N/A chdir 't' if -d 't'; 1N/A# due to a bug in VMS's piping which makes it impossible for runperl() 1N/A# to emulate echo -n (ie. stdin always winds up with a newline), these 1N/A# tests almost totally fail. 1N/A$TODO =
"runperl() unable to emulate echo -n due to pipe bug" if $^O
eq 'VMS';
1N/Ais( $r, "<foo\0><bar\0><baz\0>", "-0" ); 1N/Ais( $r, "foo\nbar\nbaz\n", "-0 after a -l" ); 1N/Ais( $r, "foo\0bar\0baz\0", "-0 before a -l" ); 1N/Ais( $r, "<foox><barx><bazx>", "-0 with octal number" ); 1N/A stdin => 'abc\ndef\n\nghi\njkl\nmno\n\npq\n', 1N/A stdin => 'abc\ndef\n\nghi\njkl\nmno\n\npq\n', 1N/Ais( $r, 'abc-def--ghi-jkl-mno--pq-/', '-0777 (slurp mode)' ); 1N/A prog => 'BEGIN { print qq{($/)} } print qq{[$/]}', 1N/Ais( $r, "(\066)[\066]", '$/ set at compile-time' ); 1N/A local $TODO = ''; # this one works on VMS 1N/A print $f <<'SWTEST'; 1N/A # Because of the stderr redirection, we can't tell reliably the order 1N/A # in which the output is given 1N/Ais( $r, 'fooxbarx', '-l with octal number' ); 1N/A prog => 'for (qw/abc def ghi/) {print defined $$_ ? $$_ : q(-)}', 1N/A args => [ '--', '-abc=2', '-def', ], 1N/Ais( $r, '21-', '-s switch parsing' ); 1N/A# Bug ID 20011106.084 1N/A print $f <<'SWTEST'; 1N/A is( $r, 'foo', '-s on the shebang line' ); 1N/A# Tests for -m and -M 1N/A print $f <<'SWTESTPM'; 1N/A is( $r, '<swtest>', '-M' ); 1N/A is( $r, '<swtest><foo>', '-M with import parameter' ); 1N/A local $TODO = ''; # this one works on VMS 1N/A is( $r, '<swtest><foo><bar>', '-m with import parameters' ); 1N/A local $TODO = ''; # these ones should work on VMS 1N/A # basic perl -V should generate significant output. 1N/A # we don't test actual format too much since it could change 1N/A '-V generates 20+ lines' ); 1N/A # lookup a known config var 1N/A is( $r, "osname='$^O';", 'perl -V:osname'); 1N/A # lookup a nonexistent var 1N/A is( $r, "this_var_makes_switches_test_fail='UNKNOWN';", 1N/A 'perl -V:unknown var'); 1N/A # platforms that don't like this quoting can either skip this test 1N/A # should be unlike( $r, qr/^$|not found|UNKNOWN/ ); 1N/A # make sure each line we got matches the re 1N/A local $TODO = ''; # these ones should work on VMS 1N/A local $TODO = ''; # these ones should work on VMS 1N/A# Tests for -z (which does not exist) 1N/A local $TODO = ''; # these ones should work on VMS 1N/A '-z correctly unknown' ); 1N/A local $TODO = ''; # these ones should work on VMS 1N/A "bar yada dada:bada bar bing:king kong bar", 1N/A "foo yada dada:bada foo bing:king kong foo",