1use warnings;
2use strict;
3
4use Test::More tests => 10;
5
6BEGIN { $^H |= 0x20000; }
7
8my $t;
9
10$t = "";
11eval q{
12	use XS::APItest qw(stmtsasexpr);
13	$t .= "a";
14	$t .= "b" . stmtsasexpr { "c"; } . "d";
15	$t .= "e";
16};
17is $@, "";
18is $t, "abcde";
19
20$t = "";
21eval 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};
28is $@, "";
29is $t, "abcde";
30
31$t = "";
32eval 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};
38is $@, "";
39is $t, "abcef";
40
41$t = "";
42eval 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};
48is $@, "";
49is $t, "abdef";
50
51$t = "";
52eval 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};
59is $@, "";
60is $t, "abcde";
61
621;
63