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

qq ignoring end of line after embedding #985

Closed
p6rt opened this issue May 10, 2009 · 5 comments
Closed

qq ignoring end of line after embedding #985

p6rt opened this issue May 10, 2009 · 5 comments
Labels

Comments

@p6rt
Copy link

p6rt commented May 10, 2009

Migrated from rt.perl.org#65538 (status was 'resolved')

Searchable as RT65538$

@p6rt
Copy link
Author

p6rt commented May 10, 2009

From @finanalyst

git log
commit d4a0b3b8b5d3b9fb781ccdd154169d58472fbc06
Author​: pmichaud <pmichaud@​pobox.com>
Date​: Sat May 2 13​:35​:22 2009 -0500

Bug (or at least inconsistent behaviour) seen in following snippet

# qq with embedded perl
print qq[first line
second line { (1,2,3).min }
third line
forth line { (1,2,3).max } and more text
fifth line
];

generates​:
first line
second line 1third line
forth line 3 and more text
fifth line

Note how 'third line' is elided onto 'second line', but 'fifth' is
separate to 'forth'

I suspect that in trimming white space from end of output after an
embedded expression, the end of line is stripped off too.

Richard <finanalyst>

@p6rt
Copy link
Author

p6rt commented Oct 11, 2009

From @kyleha

This is an automatically generated mail to inform you that tests are now available in t/spec/S02-literals/string-interpolation.t

commit 926a7abb36dcbcf22980188e18cb9e230eca409b
Author​: kyle <kyle@​c213334d-75ef-0310-aa23-eaa082d1ae64>
Date​: Sun Oct 11 22​:25​:52 2009 +0000

  [t/spec] Test for RT #​65538
 
  git-svn-id​: http://svn.pugscode.org/pugs@&#8203;28765 c213334d-75ef-0310-aa23-eaa082d1ae64

Inline Patch
diff --git a/t/spec/S02-literals/string-interpolation.t b/t/spec/S02-literals/string-interpolation.t
index 5b8de48..e6f0ebf 100644
--- a/t/spec/S02-literals/string-interpolation.t
+++ b/t/spec/S02-literals/string-interpolation.t
@@ -1,8 +1,6 @@
 use v6;
-
 use Test;
-
-plan 8;
+plan *;
 
 # L<S02/Literals/"A bare closure also interpolates in double-quotish context.">
 
@@ -28,4 +26,19 @@ plan 8;
     ok "{3}" ~~ Str, '"{3}" results in a Str';
 }
 
+my $rt65538_in = qq[line { (1,2,3).min }
+line 2
+line { (1,2,3).max } etc
+line 4
+];
+my $rt65538_out = qq[line 1
+line 2
+line 3 etc
+line 4
+];
+#?rakudo todo 'RT 65538'
+is $rt65538_in, $rt65538_out, 'interpolation does not trim newlines';
+
+done_testing;
+
 # vim: ft=perl6

@p6rt
Copy link
Author

p6rt commented Oct 11, 2009

The RT System itself - Status changed from 'new' to 'open'

@p6rt
Copy link
Author

p6rt commented Apr 5, 2010

From @jnthn

On Sun May 10 05​:08​:25 2009, richardh wrote​:

git log
commit d4a0b3b8b5d3b9fb781ccdd154169d58472fbc06
Author​: pmichaud <pmichaud@​pobox.com>
Date​: Sat May 2 13​:35​:22 2009 -0500

Bug (or at least inconsistent behaviour) seen in following snippet

# qq with embedded perl
print qq[first line
second line { (1,2,3).min }
third line
forth line { (1,2,3).max } and more text
fifth line
];

generates​:
first line
second line 1third line
forth line 3 and more text
fifth line

Note how 'third line' is elided onto 'second line', but 'fifth' is
separate to 'forth'

I suspect that in trimming white space from end of output after an
embedded expression, the end of line is stripped off too.

This works and the test written for it is now being run and passing;
resolving ticket.

Thanks,

Jonathan

@p6rt
Copy link
Author

p6rt commented Apr 5, 2010

@jnthn - Status changed from 'open' to 'resolved'

@p6rt p6rt closed this as completed Apr 5, 2010
@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