Add ARM files
[dh-make-perl] / dev / arm / libtest-simple-perl / libtest-simple-perl-0.80 / t / ok_obj.t
diff --git a/dev/arm/libtest-simple-perl/libtest-simple-perl-0.80/t/ok_obj.t b/dev/arm/libtest-simple-perl/libtest-simple-perl-0.80/t/ok_obj.t
new file mode 100644 (file)
index 0000000..8678dbf
--- /dev/null
@@ -0,0 +1,29 @@
+#!/usr/bin/perl -w
+
+# Testing to make sure Test::Builder doesn't accidentally store objects
+# passed in as test arguments.
+
+BEGIN {
+    if( $ENV{PERL_CORE} ) {
+        chdir 't';
+        @INC = '../lib';
+    }
+}
+
+use Test::More tests => 4;
+
+package Foo;
+my $destroyed = 0;
+sub new { bless {}, shift }
+
+sub DESTROY {
+    $destroyed++;
+}
+
+package main;
+
+for (1..3) {
+    ok(my $foo = Foo->new, 'created Foo object');
+}
+is $destroyed, 3, "DESTROY called 3 times";
+