test: 07-variable-or-empty.

This commit is contained in:
Jan Nieuwenhuizen 2018-11-25 11:53:29 +01:00
parent 7f2b1b1ff1
commit 1162f37d19
5 changed files with 6 additions and 2 deletions

View File

@ -45,6 +45,7 @@ tests='
07-variable-or-slash
07-variable-or-variable
07-variable-or-doublequote
07-variable-or-empty
08-variable-and
08-variable-not-and

View File

@ -41,7 +41,8 @@
;; FIXME: export/env vs set
(define %global-variables
(map identity ;; FIXME: make mutable
`(,(cons "SHELLOPTS" "")
`(,(cons "SHELL" (car (command-line)))
,(cons "SHELLOPTS" "")
,(cons "PIPESTATUS" "([0]=\"0\"")
,(cons "?" "0")
,@(map (lambda (key-value)

View File

@ -139,7 +139,7 @@
variable-subst <- dollar lbrace (variable-or / variable-and / variable-regex) rbrace
variable-or <-- name min variable-word variable-word*
variable-and <-- name plus variable-word variable-word*
variable-word <- variable-regex / substitution / variable-subst / variable / variable-literal !slash / variable-string
variable-word <- variable-regex / substitution / variable-subst / variable / variable-literal !slash / variable-string / sp*
variable-regex <-- name &slash regex-sep variable-literal '/' variable-string &rbrace /
name regex-sep variable-string
slash < '/'

View File

@ -0,0 +1 @@
echo ${bindir-}

View File

@ -0,0 +1 @@