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

Rakudo thinks Matches coerced to Hashes don't have 'exists' methods #933

Closed
p6rt opened this issue Apr 21, 2009 · 7 comments
Closed

Rakudo thinks Matches coerced to Hashes don't have 'exists' methods #933

p6rt opened this issue Apr 21, 2009 · 7 comments

Comments

@p6rt
Copy link

p6rt commented Apr 21, 2009

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

Searchable as RT64948$

@p6rt
Copy link
Author

p6rt commented Apr 21, 2009

From @masak

<masak> rakudo​: say %("foo" ~~ /foo/).exists("foo")
<p6eval> rakudo ad7389​: OUTPUT«Method 'exists' not found for invocant
of class 'Hash' [...]
<masak> that one's funny.
* masak submits rakudobug

@p6rt
Copy link
Author

p6rt commented Aug 12, 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 47c7c0d6a671619b234a9747c4107e48891e987b
Author​: kyle <kyle@​c213334d-75ef-0310-aa23-eaa082d1ae64>
Date​: Wed Aug 12 03​:51​:17 2009 +0000

  [t/spec] Test for RT #​64948
 
  git-svn-id​: http://svn.pugscode.org/pugs@&#8203;27966 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 112ffb5..a9a8e46 100644
--- a/t/spec/S05-match/capturing-contexts.t
+++ b/t/spec/S05-match/capturing-contexts.t
@@ -2,7 +2,7 @@ use v6;
 
 use Test;
 
-plan 16;
+plan 18;
 
 if !eval('("a" ~~ /a/)') {
   skip_rest "skipped tests - rules support appears to be missing";
@@ -63,4 +63,15 @@ if !eval('("a" ~~ /a/)') {
     is ~$<o>, 'o o', 'match list stringifies like a normal list AFTER "isa"';
 }
 
+# RT #64948
+{
+    #?rakudo todo 'RT #64948'
+    ok %( 'foo' ~~ /foo/ ).can( 'exists' ),
+       'Match coerced to Hash has "exists" method';
+
+    my %match_as_hash = %( 'foo' ~~ /foo/ );
+    ok %match_as_hash.can( 'exists' ),
+       'Match stored in Hash has "exists" method';
+}
+
 # vim: ft=perl6

@p6rt
Copy link
Author

p6rt commented Aug 12, 2009

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

@p6rt
Copy link
Author

p6rt commented Aug 13, 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 8f37464de8e12e033fbbdec55773a3567f5600e4
Author​: kyle <kyle@​c213334d-75ef-0310-aa23-eaa082d1ae64>
Date​: Thu Aug 13 12​:39​:58 2009 +0000

  [t/spec] Cut out the tests for RT #​64948
 
  The tests as written don't conform to the spec. I'm cutting instead of
  fixing due to time constraints with intent to return to this later.
 
  git-svn-id​: http://svn.pugscode.org/pugs@&#8203;27980 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 2431b03..0227dfe 100644
--- a/t/spec/S05-match/capturing-contexts.t
+++ b/t/spec/S05-match/capturing-contexts.t
@@ -2,7 +2,7 @@ use v6;
 
 use Test;
 
-plan 26;
+plan 20;
 
 if !eval('("a" ~~ /a/)') {
   skip_rest "skipped tests - rules support appears to be missing";
@@ -63,30 +63,6 @@ if !eval('("a" ~~ /a/)') {
     is ~$<o>, 'o o', 'match list stringifies like a normal list AFTER "isa"';
 }
 
-# RT #64948
-{
-    #?rakudo todo 'RT #64948'
-    ok %( 'foo' ~~ /<alpha> oo/ ).can( 'exists' ),
-       'Match coerced to Hash has "exists" method';
-    #?rakudo skip 'RT #64948'
-    ok %( 'foo' ~~ /<alpha> oo/ ).exists( 'alpha' ),
-       'Match coerced to Hash says "alpha" exists';
-
-    'foo' ~~ /<alpha> oo/;
-    #?rakudo todo 'RT #64948'
-    ok %( $/ ).can( 'exists' ),
-       'Match in $/ coerced to Hash has "exists" method';
-    #?rakudo skip 'RT #64948'
-    ok %( $/ ).exists( 'alpha' ),
-       'Match in $/ coerced to Hash says "alpha" exists';
-
-    my %match_as_hash = %( 'foo' ~~ /<alpha> oo/ );
-    ok %match_as_hash.can( 'exists' ),
-       'Match stored in Hash has "exists" method';
-    ok %match_as_hash.exists( 'alpha' ),
-       '"alpha" exists in Match stored in Hash';
-}
-
 # RT #64952
 {
     'ab' ~~ /(.)+/;

@p6rt
Copy link
Author

p6rt commented Aug 13, 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 81e0541ab4c7c1026da0f6a3aa1abf6b7611a3c3
Author​: kyle <kyle@​c213334d-75ef-0310-aa23-eaa082d1ae64>
Date​: Thu Aug 13 18​:56​:14 2009 +0000

  [t/spec] feeble test for RT #​64948
 
  git-svn-id​: http://svn.pugscode.org/pugs@&#8203;27982 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 0227dfe..1f9a2b8 100644
--- a/t/spec/S05-match/capturing-contexts.t
+++ b/t/spec/S05-match/capturing-contexts.t
@@ -2,7 +2,7 @@ use v6;
 
 use Test;
 
-plan 20;
+plan 21;
 
 if !eval('("a" ~~ /a/)') {
   skip_rest "skipped tests - rules support appears to be missing";
@@ -75,4 +75,11 @@ if !eval('("a" ~~ /a/)') {
     is @match[0][1], 'b', 'match element [0][1] from /(.)+/ coerced';
 }
 
+# RT #64948
+{
+    #?rakudo skip 'RT #64948'
+    ok %( 'foo' ~~ /<alpha> oo/ ){ 'alpha' }:exists,
+       'Match coerced to Hash says match exists';
+}
+
 # vim: ft=perl6

@p6rt
Copy link
Author

p6rt commented Oct 10, 2011

From @coke

On Tue Apr 21 15​:00​:15 2009, masak wrote​:

<masak> rakudo​: say %("foo" ~~ /foo/).exists("foo")
<p6eval> rakudo ad7389​: OUTPUT�Method 'exists' not found for invocant
of class 'Hash' [...]
<masak> that one's funny.
* masak submits rakudobug

19​:10 < [Coke]> rakudo​: say %("foo" ~~ /foo/).exists("foo")
19​:10 <+p6eval> rakudo 38907e​: OUTPUT«Bool​::False␤»

Works, had tests that used a not-yet functional adverbial syntax. rewrote to match sample here.
--
Will "Coke" Coleda

@p6rt
Copy link
Author

p6rt commented Oct 10, 2011

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

@p6rt p6rt closed this as completed Oct 10, 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