2 # Copyright (C) 2010, Parrot Foundation.
7 t/dynoplibs/bit.t - Bitwise Dynops
11 % prove t/dynoplibs/bit.t
15 Tests basic arithmetic on various combinations of Parrot integer and
23 .include 'test_more.pir'
27 bnot_p_p_creates_destination()
47 .sub 'bnot_p_p_creates_destination'
50 is( $P1, -4, 'bnot_p_p_creates_destination')
53 .sub bands_null_string
79 is( $S1, "A@", 'bands 2' )
80 is( $S2, "EE", 'bands 2' )
87 is( $S0, "A@", 'bands 3' )
88 is( $S1, "abc", 'bands 3' )
89 is( $S2, "EE", 'bands 3' )
95 $S1 = bands $S1, "bar"
96 is( $S2, "foo", 'bands COW' )
104 is( $S1, $S3, 'bors NULL string' )
110 is( $S1, $S3, 'bors NULL string' )
113 is( $S2, $S3, 'bors NULL string' )
118 is( $S1, "def", 'bors NULL string' )
122 is( $S1, "def", 'bors NULL string' )
128 is( $S3, $S4, 'bors NULL string' )
132 is( $S3, $S4, 'bors NULL string' )
135 is( $S3, $S4, 'bors NULL string' )
139 is( $S3, "def", 'bors NULL string' )
142 is( $S3, "def", 'bors NULL string' )
149 is( $S1, "egc", 'bors 2' )
150 is( $S2, "EE", 'bors 2' )
157 is( $S0, "egc", 'bors 3' )
158 is( $S1, "abc", 'bors 3' )
159 is( $S2, "EE", 'bors 3' )
164 substr $S2, $S1, 0, 3
165 $S1 = bors $S1, "bar"
166 is( $S2, "foo", 'bors COW' )
169 .sub bxors_null_string
174 is( $S1, $S3, 'bxors NULL string' )
180 is( $S1, $S3, 'bxors NULL string' )
183 is( $S2, $S3, 'bxors NULL string' )
188 is( $S1, "abc", 'bxors NULL string' )
192 is( $S1, "abc", 'bxors NULL string' )
198 is( $S3, $S4, 'bxors NULL string' )
202 is( $S3, $S4, 'bxors NULL string' )
205 is( $S3, $S4, 'bxors NULL string' )
209 is( $S3, "abc", 'bxors NULL string' )
212 is( $S3, "abc", 'bxors NULL string' )
219 is( $S1, "%Ec", 'bxors 2' )
220 is( $S2, "Dw", 'bxors 2' )
225 is( $S1, "ABCX", 'bxors 2' )
226 is( $S2, " X", 'bxors 2' )
233 is( $S0, "%Ec", 'bxors 3' )
234 is( $S1, "a2c", 'bxors 3' )
235 is( $S2, "Dw", 'bxors 3' )
240 is( $S0, "ABCY", 'bxors 3' )
241 is( $S1, "abc", 'bxors 3' )
242 is( $S2, " Y", 'bxors 3' )
247 substr $S2, $S1, 0, 3
248 $S1 = bxors $S1, "bar"
249 is( $S2, "foo", 'bxors COW' )
252 .sub bnots_null_string
257 is( $S1, $S3, 'bnots NULL string' )
263 is( $S1, $S3, 'bnots NULL string' )
266 is( $S2, $S3, 'bnots NULL string' )
269 # This was the previous test used for t/native_pbc/string.t
271 skip( 4, "No unicode yet" )
276 # is( $S1, "a2c", 'bnots 2' )
277 # is( $S2, "\xC2\x9E\xC3\x8D\xC2\x9C", 'bnots 2' )
280 # is( $S1, "\xC2\x9E\xC3\x8D\xC2\x9C", 'bnots 2' )
283 # is( $S1, "a2c", 'bnots 2' )
288 substr $S2, $S1, 0, 3
290 is( $S2, "foo", 'bnots COW' )
297 # vim: expandtab shiftwidth=4 ft=pir: