aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/test1.in
diff options
context:
space:
mode:
authorGravatar axel <axel@liljencrantz.se>2005-09-20 23:31:55 +1000
committerGravatar axel <axel@liljencrantz.se>2005-09-20 23:31:55 +1000
commit7ddecde54372c25fcf526e2d24807c5dac9800aa (patch)
tree1bff6e0ccd096836adb74529d53a6debcf45375b /tests/test1.in
parent149594f974350bb364a76c73b91b1d5ffddaa1fa (diff)
Add subdirectories
darcs-hash:20050920133155-ac50b-9a14c6c664dd03afbe8e15e7c7998fcfb5c3c750.gz
Diffstat (limited to 'tests/test1.in')
-rw-r--r--tests/test1.in53
1 files changed, 53 insertions, 0 deletions
diff --git a/tests/test1.in b/tests/test1.in
new file mode 100644
index 00000000..5b87fb71
--- /dev/null
+++ b/tests/test1.in
@@ -0,0 +1,53 @@
+#
+#Test aliases loops and conditionals
+#
+
+for i in 1 2 #Comment on same line as command
+#Comment inside loop
+ for j in a b
+ #Double loop
+ echo $i$j
+ end;
+end
+
+# Simple alias tests
+
+function foo
+ echo >foo.txt $argv
+end
+
+foo hello
+
+cat foo.txt |read foo
+
+if test $foo = hello;
+ echo Test 2 pass
+else
+ echo Test 2 fail
+end
+
+function foo
+ printf 'Test %s' $1; echo ' pass'
+end
+
+foo 3
+
+for i in Test for continue break and switch builtins problems;
+ switch $i
+ case Test
+ printf "%s " $i
+ case "f??"
+ printf "%s " 3
+ case "c*"
+ echo pass
+ case break
+ continue
+ echo fail
+ case and
+ break
+ echo fail
+ case "*"
+ echo fail
+ end
+end
+