This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Test for the qr// construct
authorÆvar Arnfjörð Bjarmason <avar@cpan.org>
Mon, 9 Apr 2007 20:36:58 +0000 (20:36 +0000)
committerSteve Peters <steve@fisharerojo.org>
Tue, 10 Apr 2007 02:49:07 +0000 (02:49 +0000)
From: "Ævar Arnfjörð Bjarmason" <avarab@gmail.com>
Message-ID: <51dd1af80704091336q335f0584o602b5e245bc210fe@mail.gmail.com>

Includes add to the MANIFEST

p4raw-id: //depot/perl@30880

MANIFEST
t/op/qr.t [new file with mode: 0644]

index e5dbe45..12caf9e 100644 (file)
--- a/MANIFEST
+++ b/MANIFEST
@@ -3622,6 +3622,7 @@ t/op/push.t                       See if push and pop work
 t/op/pwent.t                   See if getpw*() functions work
 t/op/qq.t                      See if qq works
 t/op/qrstack.t                 See if qr expands the stack properly
+t/op/qr.t                      See if qr works
 t/op/quotemeta.t               See if quotemeta works
 t/op/rand.t                    See if rand works
 t/op/range.t                   See if .. works
diff --git a/t/op/qr.t b/t/op/qr.t
new file mode 100644 (file)
index 0000000..f8fc32f
--- /dev/null
+++ b/t/op/qr.t
@@ -0,0 +1,20 @@
+#!./perl -w
+
+BEGIN {
+    chdir 't' if -d 't';
+    @INC = '../lib';
+    require './test.pl';
+}
+
+plan tests => 2;
+
+my $rx = qr//;
+
+is(ref $rx, "Regexp", "qr// blessed into `Regexp' by default");
+
+#
+# DESTROY doesn't do anything in the case of qr// except make sure
+# that lookups for it don't end up in AUTOLOAD lookups. But make sure
+# it's there anyway.
+#
+ok($rx->can("DESTROY"), "DESTROY method defined for Regexp");