builtins: test: Fix a = b.

This commit is contained in:
Jan Nieuwenhuizen 2018-12-03 20:59:10 +01:00
parent d4f58ffa19
commit f7617fce47
3 changed files with 8 additions and 3 deletions

View File

@ -124,6 +124,7 @@ tests='
100-cd
100-cd-foo
100-test
100-test-file
100-bracket-file

View File

@ -298,10 +298,11 @@ Options:
"))
(version? (format #t "test (GASH) ~a\n" %version))
((null? files) #f)
((or (option-ref options 'n #f)
no-options?)
((or (option-ref options 'string-not-null #f)
(and no-options?
(= (length files) 1)))
(not (string-null? file)))
((option-ref options 'z #f)
((option-ref options 'string-null #f)
(string-null? file))
((and (= (length files) 3)
(member (cadr files) '("=" "==")))

3
test/100-test.sh Normal file
View File

@ -0,0 +1,3 @@
if test a = b; then
exit 1;
fi