bop.t revision 7c478bd95313f5f23a4c958a745db2134aa03244
#!./perl
#
# test the bit operators '&', '|', '^', '~', '<<', and '>>'
#
BEGIN {
chdir 't' if -d 't';
}
# Tests don't have names yet.
# If you find tests are failing, please try adding names to tests to track
# down where the failure is, and supply your new names as a patch.
# (Just-in-time test naming)
# numerics
# shifts
# signed vs. unsigned
my $bits = 0;
# short strings
# long strings
# & truncates
# | does not truncate
# ^ does not truncate
#
#
#
#
#
#
my $a = v120.300;
my $b = v200.400;
$a ^= $b;
my $a = v120.300;
my $b = v200.400;
$a |= $b;
#
# UTF8 ~ behaviour
#
my @not36;
for (0x100...0xFFF) {
}
else {
}
}
my @not37;
for my $i (0xEEE...0xF00) {
for my $j (0x0..0x120) {
}
else {
}
}
}
SKIP: {
}
my @not39;
for my $i (0x100..0x120) {
for my $j (0x100...0x120) {
}
}
my @not40;
for my $i (0x100..0x120) {
for my $j (0x100...0x120) {
}
}
# More variations on 19 and 22.
# Tests to see if you really can do casts negative floats to unsigned properly
$neg1 = -1.0;
$neg7 = -7.0;
$a = ~$a;