Debian Codegraph @

ext/XS-APItest/t/stmtsasexpr.t

raw
1 use warnings;
2 use strict;
3
4 use Test::More tests => 10;
5
6 BEGIN { $^H |= 0x20000; }
7
8 my $t;
9
10 $t = "";
11 eval q{
12 use XS::APItest qw(stmtsasexpr);
13 $t .= "a";
14 $t .= "b" . stmtsasexpr { "c"; } . "d";
15 $t .= "e";
16 };
17 is $@, "";
18 is $t, "abcde";
19
20 $t = "";
21 eval q{
22 use XS::APItest qw(stmtsasexpr);
23 no warnings "void";
24 $t .= "a";
25 $t .= "b" . stmtsasexpr { "z"; "c"; } . "d";
26 $t .= "e";
27 };
28 is $@, "";
29 is $t, "abcde";
30
31 $t = "";
32 eval q{
33 use XS::APItest qw(stmtsasexpr);
34 $t .= "a";
35 $t .= "b" . stmtsasexpr { if($t eq "a") { "c"; } else { "d"; } } . "e";
36 $t .= "f";
37 };
38 is $@, "";
39 is $t, "abcef";
40
41 $t = "";
42 eval q{
43 use XS::APItest qw(stmtsasexpr);
44 $t .= "a";
45 $t .= "b" . stmtsasexpr { if($t eq "z") { "c"; } else { "d"; } } . "e";
46 $t .= "f";
47 };
48 is $@, "";
49 is $t, "abdef";
50
51 $t = "";
52 eval q{
53 use XS::APItest qw(stmtsasexpr);
54 no warnings "void";
55 $t .= "a";
56 $t .= "b" . stmtsasexpr { { "z"; "c"; } } . "d";
57 $t .= "e";
58 };
59 is $@, "";
60 is $t, "abcde";
61
62 1;