Raku / tap-harness6

A TAP harness for Raku
Artistic License 2.0
8 stars 15 forks source link

Fails on Rakudo Perl6 2017.10 #19

Closed CurtTilmes closed 6 years ago

CurtTilmes commented 6 years ago

Cannot assign to a readonly variable ($/) or a value

Can't run subst on $/, like this line:

https://github.com/perl6/tap-harness6/blob/master/lib/TAP.pm#L233

        make ~$/.subst(/\\('#'|'\\')/, { $_[0] }, :g)
CurtTilmes commented 6 years ago

I think I understand this, but not sure.

When the action description($/) gets called, $/ becomes write-only.

When the subst runs, it tries to write into $/, but fails because it is write-only.

If you use a different argument, it seems to work ok:

diff --git a/lib/TAP.pm b/lib/TAP.pm
index 483f936..f1fe5fc 100644
--- a/lib/TAP.pm
+++ b/lib/TAP.pm
@@ -229,8 +229,8 @@ my grammar Grammar {
             }
             make TAP::Plan.new(|%args);
         }
-        method description($/) {
-            make ~$/.subst(/\\('#'|'\\')/, { $_[0] }, :g)
+        method description($m) {
+            $m.make: ~$m.subst(/\\('#'|'\\')/, { $_[0] }, :g)
         }
         method !make_test($/) {
             my %args = (:ok($<nok> eq ''));
zoffixznet commented 6 years ago

This is one of the reasons why users shouldn't be using arbitrary development commits. This problem does not exist in 2017.10 release.

The impact of the change that caused this issue was known and it was eventually decided to revert the change. However much time you spent debugging this issue could've been avoided were you to use a tested release.

CurtTilmes commented 6 years ago

Oops, sorry about that..