Skip to content

Commit

Permalink
Add a few more integration tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mmstick committed Dec 11, 2017
1 parent 86cd3be commit 4466924
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 1 deletion.
2 changes: 1 addition & 1 deletion examples/advanced/cpu-model.ion
Expand Up @@ -2,4 +2,4 @@

# Prints the model name of the CPU

echo @[grep 'model name' /proc/cpuinfo | head -1][3..5]
echo @(grep 'model name' /proc/cpuinfo | head -1)[3..5]
8 changes: 8 additions & 0 deletions examples/braces.ion
@@ -1,25 +1,33 @@
# nested braces
echo 1{A{1,2},B{1,2}}

# permutating braces
echo {0,1}abc{2,3,4}def{5,6,7}{g,h,i}

# inclusive ranges
echo {-1...1}
echo {2...0}
echo {a...c}
echo {d...b}
echo {A...C}
echo {D...B}

# exclusive ranges
echo {-1..2}
echo {2..-1}
echo {a..d}
echo {d..a}
echo {A..D}
echo {D..A}

# inclusive stepped ranges
echo {0..2...4}
echo {a..2...e}
echo {A..2...E}
echo {0..-2...-4}
echo {e..-2...a}
echo {E..-2...A}

# exclusive stepped ranges
echo {0..2..5}
echo {a..2..f}
Expand Down
1 change: 1 addition & 0 deletions examples/braces.out
@@ -1,4 +1,5 @@
1A1 1A2 1B1 1B2
0abc2def5g 0abc2def5h 0abc2def5i 0abc2def6g 0abc2def6h 0abc2def6i 0abc2def7g 0abc2def7h 0abc2def7i 0abc3def5g 0abc3def5h 0abc3def5i 0abc3def6g 0abc3def6h 0abc3def6i 0abc3def7g 0abc3def7h 0abc3def7i 0abc4def5g 0abc4def5h 0abc4def5i 0abc4def6g 0abc4def6h 0abc4def6i 0abc4def7g 0abc4def7h 0abc4def7i 1abc2def5g 1abc2def5h 1abc2def5i 1abc2def6g 1abc2def6h 1abc2def6i 1abc2def7g 1abc2def7h 1abc2def7i 1abc3def5g 1abc3def5h 1abc3def5i 1abc3def6g 1abc3def6h 1abc3def6i 1abc3def7g 1abc3def7h 1abc3def7i 1abc4def5g 1abc4def5h 1abc4def5i 1abc4def6g 1abc4def6h 1abc4def6i 1abc4def7g 1abc4def7h 1abc4def7i
-1 0 1
2 1 0
a b c
Expand Down
1 change: 1 addition & 0 deletions examples/builtin_piping.ion
@@ -1,4 +1,5 @@
matches Foo '([A-Z])\w+' && echo true
matches foo '([A-Z])\w+' || echo false
echo foo | cat
read foo <<< $(echo bar)
echo $foo
1 change: 1 addition & 0 deletions examples/builtin_piping.out
@@ -1,3 +1,4 @@
true
false
foo
bar
6 changes: 6 additions & 0 deletions examples/continue.ion
@@ -0,0 +1,6 @@
for value in 1...10
if test 0 -eq $(( value % 2 ))
continue
end
echo $value
end
5 changes: 5 additions & 0 deletions examples/continue.out
@@ -0,0 +1,5 @@
1
3
5
7
9

0 comments on commit 4466924

Please sign in to comment.