You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I think this may be a dubious test rather than a Rakudo bug.
For reference, the code tested by the fudged test in question boils down to this:
➜ say "abbb" ~~ m:ex/"a" b+/;
(「abbb」 「abb」 「ab」)
The test then checks if the first element of the result is "ab", and the second is "abb" - which is not the case because they are returned in the opposite order.
Why is the test assuming that the results with the same starting position have to be returned in a specific order? S05 specifically states that the order is not defined in such a case:
The matches are guaranteed to be returned in left-to-right order with respect
to the starting positions. The order within each starting position is not
guaranteed and may depend on the nature of both the pattern and the matching
engine. (Conjecture: or we could enforce backtracking engine semantics. Or we
could guarantee no order at all unless the pattern starts with "::" or some
such to suppress DFAish solutions.)
(FYI: Rakudo's current behavior seems to implement the "enforce backtracking engine semantics" conjecture.)
It looks to me like the test should sort the results, before checking that the first two are "ab" and "abb".
Migrated from rt.perl.org#125133 (status was 'open')
Searchable as RT125133$
The text was updated successfully, but these errors were encountered: