This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
move Math-Big* from ./dist to ./cpan
[perl5.git] / cpan / Math-BigRat / t / bitwise.t
diff --git a/cpan/Math-BigRat/t/bitwise.t b/cpan/Math-BigRat/t/bitwise.t
new file mode 100644 (file)
index 0000000..be9aa4c
--- /dev/null
@@ -0,0 +1,15 @@
+use strict;
+use warnings;
+use Test::More tests => 22;
+
+use Math::BigRat;
+
+my $x = Math::BigRat->new('3/7');
+
+for my $op (qw(& | ^ << >> &= |= ^= <<= >>=)) {
+    ok !eval "my \$y = \$x $op 42; 1";
+    like $@, qr/^bitwise operation \Q$op\E not supported in Math::BigRat/;
+}
+
+ok !eval "my \$y = ~\$x; 1";
+like $@, qr/^bitwise operation ~ not supported in Math::BigRat/;