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
Comments
From @masak<masak> rakudo: say %("foo" ~~ /foo/).exists("foo") |
From @kylehaThis is an automatically generated mail to inform you that tests are now available in t/spec/S05-match/capturing-contexts.t commit 47c7c0d6a671619b234a9747c4107e48891e987b [t/spec] Test for RT #64948 Inline Patchdiff --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 |
The RT System itself - Status changed from 'new' to 'open' |
From @kylehaThis is an automatically generated mail to inform you that tests are now available in t/spec/S05-match/capturing-contexts.t commit 8f37464de8e12e033fbbdec55773a3567f5600e4 [t/spec] Cut out the tests for RT #64948 Inline Patchdiff --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' ~~ /(.)+/; |
From @kylehaThis is an automatically generated mail to inform you that tests are now available in t/spec/S05-match/capturing-contexts.t commit 81e0541ab4c7c1026da0f6a3aa1abf6b7611a3c3 [t/spec] feeble test for RT #64948 Inline Patchdiff --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 |
From @cokeOn Tue Apr 21 15:00:15 2009, masak wrote:
19:10 < [Coke]> rakudo: say %("foo" ~~ /foo/).exists("foo") Works, had tests that used a not-yet functional adverbial syntax. rewrote to match sample here. |
@coke - Status changed from 'open' to 'resolved' |
Migrated from rt.perl.org#64948 (status was 'resolved')
Searchable as RT64948$
The text was updated successfully, but these errors were encountered: