This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Test that Opcode loads without warnings.
authorNicholas Clark <nick@ccl4.org>
Tue, 9 Nov 2010 13:47:10 +0000 (13:47 +0000)
committerNicholas Clark <nick@ccl4.org>
Tue, 9 Nov 2010 13:47:10 +0000 (13:47 +0000)
This will fail if there are untagged ops.

ext/Opcode/t/Opcode.t

index a648373..1c0b427 100644 (file)
@@ -13,12 +13,22 @@ BEGIN {
 use strict;
 use Test::More;
 
-BEGIN {
-    use_ok('Opcode', qw(
+{
+    my @warnings;
+
+    BEGIN {
+       local $SIG{__WARN__} = sub {
+           push @warnings, "@_";
+       };
+
+       use_ok('Opcode', qw(
        opcodes opdesc opmask verify_opset
        opset opset_to_ops opset_to_hex invert_opset
        opmask_add full_opset empty_opset define_optag
-                      ));
+                          ));
+    }
+
+    is_deeply(\@warnings, [], "No warnings loading Opcode");
 }
 
 # --- opset_to_ops and opset