Debian Codegraph @

ext/XS-APItest/t/labelconst.t

raw
1 use warnings;
2 use strict;
3
4 use Test::More tests => 32;
5
6 BEGIN { $^H |= 0x20000; }
7
8 my $t;
9
10 $t = "";
11 eval q{
12 use XS::APItest qw(labelconst);
13 $t .= "a";
14 $t .= labelconst b:;
15 $t .= "c";
16 };
17 is $@, "";
18 is $t, "abc";
19
20 $t = "";
21 eval q{
22 use XS::APItest qw(labelconst);
23 $t .= "a";
24 $t .= "b" . labelconst FOO: . "c";
25 $t .= "d";
26 };
27 is $@, "";
28 is $t, "abFOOcd";
29
30 $t = "";
31 eval q{
32 use XS::APItest qw(labelconst);
33 $t .= "a";
34 $t .= labelconst FOO :;
35 $t .= "b";
36 };
37 is $@, "";
38 is $t, "aFOOb";
39
40 $t = "";
41 eval q{
42 use XS::APItest qw(labelconst);
43 $t .= "a";
44 $t .= labelconst F_1B:;
45 $t .= "b";
46 };
47 is $@, "";
48 is $t, "aF_1Bb";
49
50 $t = "";
51 eval q{
52 use XS::APItest qw(labelconst);
53 $t .= "a";
54 $t .= labelconst _AB:;
55 $t .= "b";
56 };
57 is $@, "";
58 is $t, "a_ABb";
59
60 $t = "";
61 eval q{
62 use XS::APItest qw(labelconst);
63 no warnings;
64 $t .= "a";
65 $t .= labelconst 1AB:;
66 $t .= "b";
67 };
68 isnt $@, "";
69 is $t, "";
70
71 $t = "";
72 eval q{
73 use XS::APItest qw(labelconst);
74 $t .= "a";
75 $t .= labelconst :;
76 $t .= "b";
77 };
78 isnt $@, "";
79 is $t, "";
80
81 $t = "";
82 eval q{
83 use XS::APItest qw(labelconst);
84 $t .= "a";
85 $t .= labelconst ;
86 $t .= "b";
87 };
88 isnt $@, "";
89 is $t, "";
90
91 $t = "";
92 $t = do("./t/labelconst.aux");
93 is $@, "";
94 is $t, "FOOBARBAZQUUX";
95
96 {
97 use utf8;
98 use open qw( :utf8 :std );
99
100 $t = "";
101 eval q{
102 use XS::APItest qw(labelconst);
103 $t .= "ㅏ";
104 $t .= labelconst ᛒ:;
105 $t .= "ḉ";
106 };
107 is $@, "";
108 is $t, "ㅏᛒḉ";
109
110 $t = "";
111 eval q{
112 use XS::APItest qw(labelconst);
113 $t .= "ㅏ";
114 $t .= "ᛒ" . labelconst FǑǑ: . "ḉ";
115 $t .= "d";
116 };
117 is $@, "";
118 is $t, "ㅏᛒFǑǑḉd";
119
120 $t = "";
121 eval q{
122 use XS::APItest qw(labelconst);
123 $t .= "ㅏ";
124 $t .= labelconst FǑǑ :;
125 $t .= "ᛒ";
126 };
127 is $@, "";
128 is $t, "ㅏFǑǑᛒ";
129
130 $t = "";
131 eval q{
132 use XS::APItest qw(labelconst);
133 $t .= "ㅏ";
134 $t .= labelconst F_1Ḅ:;
135 $t .= "ᛒ";
136 };
137 is $@, "";
138 is $t, "ㅏF_1Ḅᛒ";
139
140 $t = "";
141 eval q{
142 use XS::APItest qw(labelconst);
143 $t .= "ㅏ";
144 $t .= labelconst _AḄ:;
145 $t .= "ᛒ";
146 };
147 is $@, "";
148 is $t, "ㅏ_AḄᛒ";
149
150 $t = "";
151 eval q{
152 use XS::APItest qw(labelconst);
153 no warnings;
154 $t .= "ㅏ";
155 $t .= labelconst 1AḄ:;
156 $t .= "ᛒ";
157 };
158 isnt $@, "";
159 is $t, "";
160
161 }
162
163 {
164 use utf8;
165 $t = "";
166 $t = do("./t/labelconst_utf8.aux");
167 is $@, "";
168 is $t, "FǑǑBÀRᛒÀZQÙÙX";
169 }
170
171 1;