add tests to check if context propagation works
François Désarménien [Sun, 19 Jul 1998 12:28:33 +0000 (14:28 +0200)]
Message-ID: <35B1CA51.A606AD27@club-internet.fr>
Subject: Re: m//g strange behaviour in 5.004

p4raw-id: //depot/perl@1599

MANIFEST
t/op/context.t [new file with mode: 0755]

index 6c82f65..21c2f94 100644 (file)
--- a/MANIFEST
+++ b/MANIFEST
@@ -882,6 +882,7 @@ t/op/chop.t         See if chop works
 t/op/closure.t         See if closures work
 t/op/cmp.t             See if the various string and numeric compare work
 t/op/cond.t            See if conditional expressions work
+t/op/context.t         See if context propagation works
 t/op/defins.t          See if auto-insert of defined() works
 t/op/delete.t          See if delete works
 t/op/die.t             See if die works
diff --git a/t/op/context.t b/t/op/context.t
new file mode 100755 (executable)
index 0000000..4625441
--- /dev/null
@@ -0,0 +1,18 @@
+#!./perl
+
+$n=0;
+
+print "1..3\n";
+
+sub foo {
+    $a='abcd';
+
+    $a=~/(.)/g;
+
+    $1 eq 'a' or print 'not ';
+    print "ok ",++$n,"\n";
+}
+
+$a=foo;
+@a=foo;
+foo;