]> git.vpit.fr Git - perl/modules/with.git/blob - t/11-skip.t
Importing with-0.01
[perl/modules/with.git] / t / 11-skip.t
1 #!perl -T
2
3 package main;
4
5 use strict;
6 use warnings;
7
8 use Test::More 'no_plan';
9
10 sub with::Mock::right { pass $_[1] }
11 sub with::Mock::wrong { fail $_[1] }
12 sub with::Mock::test  { is $_[1], $_[2], $_[3] }
13
14 use with \bless {}, 'with::Mock';
15
16 right 'normal';
17 my $s = q{wrong 'string'};
18 test $s, q{wrong 'string'}, 'string is preserved';
19 # no with;
20 right
21   'after string';
22 # wrong('comments');
23 right 'after comment';
24 =pod
25 wrong('POD');
26 =cut
27 right q/after POD/;
28 my $x = "heredoc"; right "before $x";
29 my $y = <<HEREDOC;
30 wrong('heredoc');
31 HEREDOC
32 right qq[after heredoc];
33 test $y, "wrong('heredoc');\n", 'heredoc is preserved';
34 my $d = <DATA>;
35 test $d, "wrong '__DATA__';\n", 'data is preserved';
36 __DATA__
37 wrong '__DATA__';