Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

[t/spec] fudge misc-interpolation.t for rakudo - passes, but it's sti…

…ll bad

plan


git-svn-id: http://svn.pugscode.org/pugs@24518 c213334d-75ef-0310-aa23-eaa082d1ae64
  • Loading branch information...
commit 224f29a18026a9e094b347c34fc6bf5c13e80457 1 parent 1e2c563
moritz authored
Showing with 15 additions and 0 deletions.
  1. +15 −0 S02-literals/misc-interpolation.t
View
15 S02-literals/misc-interpolation.t
@@ -21,27 +21,38 @@ sub func_w_args($x,$y) { return "[$x][$y]" }
# Double quotes
is("Hello $world", 'Hello World', 'double quoted string interpolation works');
+#?rakudo todo 'array interpolation'
is("@list[]\ 3 4", '1 2 3 4', 'double quoted list interpolation works');
is("@list 3 4", '@list 3 4', 'array without empty square brackets does not interpolate');
+#?rakudo todo 'hash interpolation'
is("%hash{}", "1\t2\n", 'hash interpolation works');
is("%hash", '%hash', 'hash interpolation does not work if not followed by {}');
+#?rakudo todo 'interpolation of &function()'
is("Wont you take me to &func()", 'Wont you take me to func-y town', 'closure interpolation');
is("2 + 2 = { 2+2 }", '2 + 2 = 4', 'double quoted closure interpolation works');
+
+#?rakudo todo 'interpolation of &function()'
is("&func() is where I live", 'func-y town is where I live', "make sure function interpolation doesn't eat all trailing whitespace");
is("$number {$number}", '1 1', 'number inside and outside closure works');
is("$number {my $number=2}", '1 2', 'local version of number in closure works');
is("$number {my $number=2} $number", '1 2 1', 'original number still available after local version in closure: works' );
+#?rakudo skip 'Null PMC access in get_bool()'
+{
eval( q[is("$number {my $number=2} {$number}", '1 2 1', 'original number
still available in closure after local version in closure: works' );] ) or ok('');
eval( q[is("$(my $x = 2) $x", '2 2', 'Variable should interpolate and still be available in the outer scope.');] ) // ok('', 'Syntax should be recognized for $(my $x = 2)');
eval( q[is("$(my $x = 2)" ~ $x, '22', 'Variable should interpolate and still be available in the outer scope.');] ) // ok('', 'Syntax should be recognized for $(my $x = 2)');
+}
# L<S02/Names and Variables/form of each subscript>
is("&func. () is where I live", '&func. () is where I live', '"&func. ()" should not interpolate');
+#?rakudo skip 'parse failure'
is("&func_w_args("foo","bar"))", '[foo][bar])', '"&func_w_args(...)" should interpolate');
# L<S02/Literals/"In order to interpolate the result of a method call">
+#?rakudo todo 'method interpolation'
is("$world.chars()", '5', 'method calls with parens should interpolate');
is("$world.chars", 'World.chars', 'method calls without parens should not interpolate');
+#?rakudo 2 todo 'method interpolation'
is("$world.reverse.chars()", '5', 'cascade of argumentless methods, last ending in paren');
is("$world.substr(0,1)", 'W', 'method calls with parens and args should interpolate');
@@ -60,6 +71,7 @@ is(qq{a{chr 98}c}, 'abc', "curly brace delimiters don't interfere with closure i
# Quoting constructs
# The next test will always succeed, but if there's a bug it probably
# won't compile.
+#?rakudo 6 skip 'Q quoting'
is(Q"abc\\d\\'\/", Q"abc\\d\\'\/", "raw quotation works");
is(q"abc\\d\"\'\/", Q|abc\d"\'\/|, "single quotation works"); #"
is(qq"abc\\d\"\'\/", Q|abc\d"'/|, "double quotation works"); #"
@@ -67,13 +79,16 @@ is(qa"$world @list[] %hash{}", Q"$world 1 2 %hash{}", "only interpolate array");
is(qb"$world \\\"\n\t", "\$world \\\"\n\t", "only interpolate backslash");
is('$world \qq[@list[]] %hash{}', '$world 1 2 %hash{}', "interpolate quoting constructs in ''");
+#?rakudo todo '\c interpolation'
is(" \c[111] \c[107] ", ' o k ', "\\c[] respects whitespaces around it");
# L<S02/Literals/separating the numbers with comma:>
is("x \x[41,42,43] x", "x ABC x", "\\x[] allows multiple chars (1)");
is("x \x[41,42,00043] x", "x ABC x", "\\x[] allows multiple chars (2)");
+#?rakudo 2 todo '\c interpolation'
is("x \c[65,66,67] x", "x ABC x", "\\c[] allows multiple chars (1)");
is("x \c[65,66,000067] x", "x ABC x", "\\c[] allows multiple chars (2)");
is("x \x[41,42,43]] x", "x ABC] x", "\\x[] should not eat following ]s");
+#?rakudo todo '\c interpolation'
is("x \c[65,66,67]] x", "x ABC] x", "\\c[] should not eat following ]s");
Please sign in to comment.
Something went wrong with that request. Please try again.