root/t/run/10-dash-uppercase-m.t

Revision 22093, 1.1 kB (checked in by lwall, 4 months ago)

[t] more system, require, does, defer, label cleanup

  • Property svn:mime-type set to text/plain; charset=UTF-8
  • Property svn:eol-style set to native
Line 
1use v6;
2
3use Test;
4
5force_todo 4;
6
7=begin pod
8
9Test handling of C<-Mmodule>.
10
11=end pod
12
13my $dir = "t/run";
14
15my @tests = (
16  "-I$dir -MDummy -e load_test",
17  "-e load_test -MDummy -I$dir",
18# temporarily run below
19#  "-I$dir -MDummy $dir/10-dash-uppercase-m.pl"
20);
21
22plan 4;
23if $*OS eq "browser" {
24  skip_rest "Programs running in browsers don't have access to regular IO.";
25  exit;
26}
27
28diag "Running under $*OS";
29
30my $redir = ">";
31
32sub nonce () { return (".{$*PID}." ~ ((1..1000).pick) ~ ".tmp") }
33sub run_pugs ($c) {
34  my $tempfile = "temp-ex-output" ~ nonce;
35  my $command = "$*EXECUTABLE_NAME $c $redir $tempfile";
36  diag $command;
37  run $command;
38  my $res = slurp $tempfile;
39  unlink $tempfile;
40  return $res;
41}
42
43push @*INC, $dir;
44require Dummy; pass "(dummy instead of broken use_ok)";
45
46for @tests -> $test {
47  my $output = run_pugs($test);
48  is( $output, "Module Dummy.pm was loaded\n", "Module was loaded");
49};
50
51# when this works, delete this line, and uncomment this case in the list above.
52is(run_pugs("-I$dir -MDummy $dir/10-dash-uppercase-m.pl"), "Module Dummy.pm was loaded\n", "Module was loaded", :todo<bug>);
Note: See TracBrowser for help on using the browser.