7 Test rejection of unknown command line switches.
11 Unrecognized switch: -foo (-h will show valid options).
13 if called with the (unknown) option C<-foo>
17 my @examples = map -> Junction $_ { $_.eigenstates },
18 map -> Junction $_ { $_.eigenstates }, (
19 any('-foo ', '-e "print" -foo ', '-c -foo ', '-eprint -foo ')
20 ~ any("", '-e "print" ', '-c '),
24 if $*OS eq "browser" {
25 skip_rest "Programs running in browsers don't have access to regular IO.";
29 diag "Running under $*OS";
34 sub nonce () { return (".{$*PID}." ~ (1..1000).pick) }
36 for @examples -> $ex {
37 my $out_fn = "temp-ex-output" ~ nonce;
38 my $command = "$*EXECUTABLE $ex $redir $out_fn";
42 my $expected = "Unrecognized switch: -foo (-h will show valid options).\n";
43 my $got = slurp $out_fn;
46 is $got, $expected, "$ex works", :todo;