Skip to content

Commit bc7e480

Browse files
committed
Add a few moreinput related tests.
1 parent f65ba97 commit bc7e480

File tree

1 file changed

+38
-1
lines changed

1 file changed

+38
-1
lines changed

t/02-rakudo/repl.t

Lines changed: 38 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use v6;
22
use Test;
33

4-
plan 3;
4+
plan 6;
55

66
# Sanity check that the repl is working at all.
77
my $cmd = $*DISTRO.is-win
@@ -42,3 +42,40 @@ sub feed_repl_with ( @lines ) {
4242
is feed_repl_with( @input-lines ).lines, (4, 4),
4343
'can use native typed variable on subsequent lines (1)';
4444
}
45+
46+
#rakudo todo "some indent styles don't parse right"
47+
{
48+
my @input-lines = q:to/END/.split("\n");
49+
if False {
50+
say ":(";
51+
}
52+
else {
53+
say ":)";
54+
}
55+
END
56+
is feed_repl_with( @input-lines ).lines, ":)",
57+
"uncuddled else is parsed correctly";
58+
59+
@input-lines = q:to/END/.split("\n");
60+
if False
61+
{
62+
say ":(";
63+
}
64+
else
65+
{
66+
say ":)";
67+
}
68+
END
69+
is feed_repl_with( @input-lines ).lines, ":)",
70+
"open brace on next line is parsed correctly";
71+
72+
@input-lines = q:to/END/.split("\n");
73+
if False {
74+
say ":(";
75+
} else {
76+
say ":)";
77+
}
78+
END
79+
is feed_repl_with( @input-lines ).lines, ":)",
80+
"cuddled else is parsed correctly";
81+
}

0 commit comments

Comments
 (0)