This commit is contained in:
parent
a72724695b
commit
2fbfd6d88a
|
@ -486,6 +486,16 @@ func TestBuiltins_While(t *testing.T) {
|
||||||
set x (add $x 1)
|
set x (add $x 1)
|
||||||
}
|
}
|
||||||
echo "done"`, want: "done\n(nil)\n"},
|
echo "done"`, want: "done\n(nil)\n"},
|
||||||
|
{desc: "iterate while true with pipeline", expr: `
|
||||||
|
set x 0
|
||||||
|
while (lt $x 5) {
|
||||||
|
echo $x
|
||||||
|
set x (add $x 1)
|
||||||
|
if (ge $x 3) {
|
||||||
|
break "Ahh"
|
||||||
|
}
|
||||||
|
} | echo " was the break"
|
||||||
|
echo "done"`, want: "0\n1\n2\nAhh was the break\ndone\n(nil)\n"},
|
||||||
{desc: "iterate for ever with break 1", expr: `
|
{desc: "iterate for ever with break 1", expr: `
|
||||||
set x 0
|
set x 0
|
||||||
while {
|
while {
|
||||||
|
|
Loading…
Reference in a new issue