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
The string-oriented bitwise ops generate Parrot strings (instead of Rakudo strings) in Rakudo #1162
Comments
From @masak<moritz_> rakudo: say ('r' ~& 's').PARROT |
From @kylehaThis is an automatically generated mail to inform you that tests are now available in t/spec/S03-operators/bit.t commit 8579d5842f0fa3907dc40cf7f9747019fdf4670c [t/spec] Test for RT #67852 Inline Patchdiff --git a/t/spec/S03-operators/bit.t b/t/spec/S03-operators/bit.t
index 514d215..56500dc 100644
--- a/t/spec/S03-operators/bit.t
+++ b/t/spec/S03-operators/bit.t
@@ -4,7 +4,7 @@ use Test;
# Mostly copied from Perl 5.8.4 s t/op/bop.t
-plan 22;
+plan 24;
# test the bit operators '&', '|', '^', '+<', and '+>'
@@ -98,5 +98,9 @@ plan 22;
#if ("ok \xFF\x{FF}\n" ~& "ok 41\n" eq "ok 41\n") { say "ok 19" } else { say "not ok 19" }
#if ("ok \x{FF}\xFF\n" ~& "ok 42\n" eq "ok 42\n") { say "ok 20" } else { say "not ok 20" }
-
-
+# RT #67852
+{
+ lives_ok { 'normal'.trans() }, 'can .trans() on normal string';
+ #?rakudo todo 'RT #67852'
+ lives_ok { ('bit' ~& 'wise').trans() }, 'can .trans() on bitwise result';
+} |
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 at least one of these files: t/spec/S03-operators/bit.t, t/spec/integration/real-strings.t commit 5ae130e70da1e0276ef5350a8b93f3605dd3cead [t/spec] move tests for RT #67852 to integration/real-strings.t Inline Patchdiff --git a/t/spec/S03-operators/bit.t b/t/spec/S03-operators/bit.t
index fde6101..410ae9c 100644
--- a/t/spec/S03-operators/bit.t
+++ b/t/spec/S03-operators/bit.t
@@ -4,7 +4,7 @@ use Test;
# Mostly copied from Perl 5.8.4 s t/op/bop.t
-plan 24;
+plan 22;
# test the bit operators '&', '|', '^', '+<', and '+>'
@@ -98,11 +98,4 @@ plan 24;
#if ("ok \xFF\x{FF}\n" ~& "ok 41\n" eq "ok 41\n") { say "ok 19" } else { say "not ok 19" }
#if ("ok \x{FF}\xFF\n" ~& "ok 42\n" eq "ok 42\n") { say "ok 20" } else { say "not ok 20" }
-# RT #67852
-{
- lives_ok { 'normal'.trans() }, 'can .trans() on normal string';
- #?rakudo todo 'RT #67852'
- lives_ok { ('bit' ~& 'wise').trans() }, 'can .trans() on bitwise result';
-}
-
# vim: ft=perl6
diff --git a/t/spec/integration/real-strings.t b/t/spec/integration/real-strings.t
index 9707aee..6a01298 100644
--- a/t/spec/integration/real-strings.t
+++ b/t/spec/integration/real-strings.t
@@ -58,6 +58,12 @@ is "helo".lc.trans(("aeiou" => "AEIOU")), 'hElO', '.flip.trans (RT 66300)';
is $x, +%*VM.keys, '%*VM.kv is self-consistent';
}
+# RT #67852
+{
+ lives_ok { 'normal'.trans() }, 'can .trans() on normal string';
+ #?rakudo todo 'RT 67852'
+ lives_ok { ('bit' ~& 'wise').trans() }, 'can .trans() on bitwise result';
+}
done_testing;
# vim: ft=perl6 |
From @felliottHello, Attached is a patch that I think fixes this bug. With it, make spectest Cheers, |
From @felliott0001-return-Perl6-strings-from-bitwise-ops.patchFrom b895280a8b4bd88cb21fdf93f84077302c36def2 Mon Sep 17 00:00:00 2001
From: Fitz Elliott <felliott@virginia.edu>
Date: Tue, 27 Jul 2010 23:27:29 -0400
Subject: [PATCH] return Perl6 strings from bitwise ops
---
src/core/operators.pm | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/core/operators.pm b/src/core/operators.pm
index 8b21c12..83487ee 100644
--- a/src/core/operators.pm
+++ b/src/core/operators.pm
@@ -86,15 +86,15 @@ our multi sub infix:��+>��($a, $b) {
}
our multi sub infix:<~|>($a, $b) {
- pir::bors__SSS($a, $b);
+ ~pir::bors__SSS($a, $b);
}
our multi sub infix:<~&>($a, $b) {
- pir::bands__SSS($a, $b);
+ ~pir::bands__SSS($a, $b);
}
our multi sub infix:<~^>($a, $b) {
- pir::bxors__SSS($a, $b);
+ ~pir::bxors__SSS($a, $b);
}
our sub all(*@items) {
--
1.7.2
|
From @bbkrNOM: there is some regression, trans is NYI in this branch. bbkr:nom bbkr$ ./perl6 -e '("bit" ~& "wise").trans()' |
From @moritzThe bit ops now generate real Perl 6 Str objects, and .trans is back. |
@moritz - Status changed from 'open' to 'resolved' |
Migrated from rt.perl.org#67852 (status was 'resolved')
Searchable as RT67852$
The text was updated successfully, but these errors were encountered: