Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Regex matches in void context don't set $/ in Rakudo #1032

Closed
p6rt opened this issue Jun 3, 2009 · 5 comments
Closed

Regex matches in void context don't set $/ in Rakudo #1032

p6rt opened this issue Jun 3, 2009 · 5 comments

Comments

@p6rt
Copy link

p6rt commented Jun 3, 2009

Migrated from rt.perl.org#66252 (status was 'resolved')

Searchable as RT66252$

@p6rt
Copy link
Author

p6rt commented Jun 3, 2009

From @masak

<pmichaud> rakudo​: my $x = "test"; given $x { say $_; m/(e.)/; say $/ }
<p6eval> rakudo c907d3​: OUTPUT«test␤Use of uninitialized value␤␤»
<pmichaud> bug.
* masak submits rakudobug
<masak> rakudo​: $_ = 'test'; say $_; m/(e.)/; say $/
<p6eval> rakudo c907d3​: OUTPUT«test␤Use of uninitialized value␤␤»

@p6rt
Copy link
Author

p6rt commented Nov 4, 2009

From @kyleha

This is an automatically generated mail to inform you that tests are now available in t/spec/S05-match/capturing-contexts.t

commit 3ace0ce336a3780127e8d1ef8f5e4c62dc446c96
Author​: kyle <kyle@​c213334d-75ef-0310-aa23-eaa082d1ae64>
Date​: Wed Nov 4 20​:23​:35 2009 +0000

  [t/spec] Test for RT 66252​: match in void context does not set $/
 
  git-svn-id​: http://svn.pugscode.org/pugs@&#8203;28985 c213334d-75ef-0310-aa23-eaa082d1ae64

Inline Patch
diff --git a/t/spec/S05-match/capturing-contexts.t b/t/spec/S05-match/capturing-contexts.t
index 609480f..93f0e37 100644
--- a/t/spec/S05-match/capturing-contexts.t
+++ b/t/spec/S05-match/capturing-contexts.t
@@ -93,6 +93,15 @@ is_run( q{'aa' ~~ /(.)$1/},
         },
         'match with non-existent capture emits a warning' );
 
+# RT #66252
+{
+    $_ = 'RT 66252';
+    /(R.)/;
+    #?rakudo 2 todo 'RT 66252'
+    isa_ok $/, 'Match', 'Match object in $/ after match in void context';
+    is $/, 'RT', 'Matched as intended in void context';
+}
+
 done_testing;
 
 # vim: ft=perl6

@p6rt
Copy link
Author

p6rt commented Nov 4, 2009

The RT System itself - Status changed from 'new' to 'open'

@p6rt
Copy link
Author

p6rt commented Feb 23, 2011

From @moritz

corrected tests now pass.

@p6rt
Copy link
Author

p6rt commented Feb 23, 2011

@moritz - Status changed from 'open' to 'resolved'

@p6rt p6rt closed this as completed Feb 23, 2011
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant