test: Update test suite.

This commit is contained in:
Jan Nieuwenhuizen 2018-10-31 20:22:13 +01:00
parent 1f9480cda1
commit 6203f8cf07
27 changed files with 43 additions and 11 deletions

View File

@ -16,6 +16,7 @@ list
ls
nesting
pipe
pipe-3
substitution
00-exit
01-exit-0
@ -24,10 +25,11 @@ substitution
04-echo-var
05-assignment-doublequoted-doublequotes
05-assignment
06-assignment-echo
06-assignment-singlequote
07-assignment-double-quote
08-assignment-variable-word
05-assignment-empty
05-assignment-echo
05-assignment-singlequote
05-assignment-double-quote
05-assignment-variable-word
09-compound-word
0a-assign-substitute
0b-command-compound-word

View File

@ -77,7 +77,7 @@
(command (cons program (cdr command))))
(or (builtin command #:prefer-builtin? (or %prefer-builtins?
escape-builtin?))
(cut apply (compose status:exit-val system*) command))))
(lambda _ (status:exit-val (apply system* command))))))
(else (lambda () #t))))
(exec (append-map glob args)))
@ -118,9 +118,7 @@
(string-join (append-map glob o) ""))
(define (sequence . args)
(format (current-error-port) "sequence args=~s\n" args)
(let ((glob (append-map glob (apply append args))))
(format (current-error-port) " => sequence glob=~s\n" glob)
glob))
(define (run ast)

View File

@ -8,7 +8,7 @@ SHELL=${SHELL-bin/gash}
t=$1
b=test/$(basename $t .sh)
set +e
$SHELL -e $b.sh > $b.1 2> $b.2
timeout 1 $SHELL -e $b.sh > $b.1 2> $b.2
r=$?
set -e
if [ -f $b.exit ]; then

View File

@ -0,0 +1 @@
cc -DALIASPATH="alias" -DLOCALEDIR="x"

View File

@ -0,0 +1,2 @@
a=
echo a=$a

View File

@ -0,0 +1 @@
a=

View File

@ -0,0 +1 @@
cc -c ./

View File

@ -1,2 +1,3 @@
obj=ar.o
objs="$objs `basename $obj`"
echo "objs:>$objs<"

View File

@ -0,0 +1 @@
objs:> ar.o<

View File

@ -0,0 +1 @@
-I ar.o

View File

@ -0,0 +1,2 @@
compiling ar.o...
compiling arscan.o...

0
test/data/star/0 Normal file
View File

0
test/data/star/1 Normal file
View File

0
test/data/star/2 Normal file
View File

0
test/data/star/3 Normal file
View File

View File

@ -1,5 +1,4 @@
one=1
two_n_halve=
for i in 0 $one 2 $two_n_halve 3 ""; do
for i in 0 $one 2 $two_n_halve $two_n_quaaar and 3 ""; do
echo $i;
done

View File

@ -0,0 +1,6 @@
0
1
2
and
3

1
test/iohere.stdout Normal file
View File

@ -0,0 +1 @@
foobar

1
test/nesting.stdout Normal file
View File

@ -0,0 +1 @@
foo "bar"

1
test/pipe-3.sh Normal file
View File

@ -0,0 +1 @@
echo -e 'a\nb\nc' test/data/star/* | sed 's, ,\n,g' | cat

7
test/pipe-3.stdout Normal file
View File

@ -0,0 +1,7 @@
a
b
c
test/data/star/0
test/data/star/1
test/data/star/2
test/data/star/3

View File

@ -1 +1 @@
echo -e 'a\nb\nc' * | sed 's, ,\n,g' | cat
echo -e 'a\nb\nc' test/data/star/* | \sed 's, ,\n,g'

7
test/pipe.stdout Normal file
View File

@ -0,0 +1,7 @@
a
b
c
test/data/star/0
test/data/star/1
test/data/star/2
test/data/star/3