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

$/.perl doesn't round-trip when captures are present #5683

Open
p6rt opened this issue Sep 19, 2016 · 1 comment
Open

$/.perl doesn't round-trip when captures are present #5683

p6rt opened this issue Sep 19, 2016 · 1 comment
Labels

Comments

@p6rt
Copy link

p6rt commented Sep 19, 2016

Migrated from rt.perl.org#129307 (status was 'new')

Searchable as RT129307$

@p6rt
Copy link
Author

p6rt commented Sep 19, 2016

From @zoffixznet

The S05-match/perl.t contains this test​:

  is-deeply EVAL($/.perl), $/, 'EVAL of Match.perl recreates Match';

However, the test doesn't catch this variant that fails to recreate the exact Match​:

  "ac" ~~ /(.)(.)?(.)/;
  is-deeply $/.perl.EVAL, $/;
 
  # Failed test at /tmp/2td1RCdiII line 1
  # expected​: Match.new(ast => Any, list => (Match.new(ast => Any, list => (), hash => Map.new(()), orig => "ac", to => 1, from => 0)), hash => Map.new(("" => [])), orig => "ac", to => 2, from => 0)
  # got​: Match.new(ast => Any, list => (), hash => Map.new(()), orig => "ac", to => 2, from => 0) «exit code = 1»

This appears to have been the case since 2015.07, where the output is slightly different, but the `list` key is still empty​:

  # Failed test at /tmp/VGpy7_vt6i line 1
  # expected​: Match.new(ast => Any, list => (Match.new(ast => Any, list => (), hash => EnumMap.new(), orig => "ac", to => 1, from => 0), Any, Match.new(ast => Any, list => (), hash => EnumMap.new(), orig => "ac", to => 2, from => 1)), hash => EnumMap.new("" => []), orig => "ac", to => 2, from => 0)
  # got​: Match.new(ast => Any, list => (), hash => EnumMap.new(), orig => "ac", to => 2, from => 0) «exit code = 1»

@p6rt p6rt added the Bug label Jan 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant