summaryrefslogtreecommitdiff
path: root/ext/XS-APItest/t/xsub_h.t
diff options
context:
space:
mode:
Diffstat (limited to 'ext/XS-APItest/t/xsub_h.t')
-rw-r--r--ext/XS-APItest/t/xsub_h.t25
1 files changed, 25 insertions, 0 deletions
diff --git a/ext/XS-APItest/t/xsub_h.t b/ext/XS-APItest/t/xsub_h.t
index c25b3a9a8c..8735552152 100644
--- a/ext/XS-APItest/t/xsub_h.t
+++ b/ext/XS-APItest/t/xsub_h.t
@@ -89,4 +89,29 @@ foreach $XS_VERSION (undef, @versions) {
}
}
+{
+ my $count = 0;
+ {
+ package Counter;
+ our @ISA = 'version';
+ sub new {
+ ++$count;
+ return version::new(@_);
+ }
+
+ sub DESTROY {
+ --$count;
+ }
+ }
+
+ {
+ my $var = Counter->new();
+ is ($count, 1, "1 object exists");
+ is (eval {XS_VERSION_empty('main', $var); 1}, undef);
+ like ($@, qr/Invalid version format \(version required\)/);
+ }
+
+ is ($count, 0, "no objects exist");
+}
+
done_testing();