ui: Improve reporting of missing closing parentheses.

Suggested by Ricardo Wurmus.
Works around <https://bugs.gnu.org/28295>.

* guix/ui.scm (report-load-error): Add case for 'read-error'.
* tests/guix-system.sh: Test missing-closing-paren errors.
This commit is contained in:
Ludovic Courtès 2017-10-10 10:22:43 +02:00
parent 3f81ca324b
commit a6e22d8445
No known key found for this signature in database
GPG key ID: 090B11993D9AEBB5
2 changed files with 24 additions and 0 deletions

View file

@ -53,6 +53,21 @@ else
fi
cat > "$tmpfile"<<EOF
;; This is line 1, and the next one is line 2.
(operating-system
;; This is line 3, and there is no closing paren!
EOF
if guix system vm "$tmpfile" 2> "$errorfile"
then
# This must not succeed.
exit 1
else
grep "$tmpfile:4:1: missing closing paren" "$errorfile"
fi
# Reporting of unbound variables.
cat > "$tmpfile" <<EOF