diff --git a/check.sh b/check.sh index 4d0cd40..275f9e0 100755 --- a/check.sh +++ b/check.sh @@ -124,6 +124,7 @@ tests=' 100-cd 100-cd-foo +100-test 100-test-file 100-bracket-file diff --git a/gash/builtins.scm b/gash/builtins.scm index 84235cc..48eabb4 100644 --- a/gash/builtins.scm +++ b/gash/builtins.scm @@ -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) '("=" "=="))) diff --git a/test/100-test.sh b/test/100-test.sh new file mode 100644 index 0000000..6e513ec --- /dev/null +++ b/test/100-test.sh @@ -0,0 +1,3 @@ +if test a = b; then + exit 1; +fi