diff options
author | Ludovic Courtès <ludo@gnu.org> | 2021-04-29 11:33:27 +0200 |
---|---|---|
committer | Andy Wingo <wingo@pobox.com> | 2021-04-29 21:36:21 +0200 |
commit | 8c1a26f4d4311e2e90f006545e31e3f4638ed2b6 (patch) | |
tree | 7ac5e75b93efeb441b77d7ce5ac1e9a3cf24007a | |
parent | 19f38a38fde7da5fbcf29d0ebc4574e993210110 (diff) | |
download | guile-8c1a26f4d4311e2e90f006545e31e3f4638ed2b6.tar.gz |
bug#48089: Guile 3.0.6 returns zero-indexed locations for ‘read-error’
Ludovic Courtès <ludo@gnu.org> skribis:
> Guile 3.0.6 returns zero-indexed (instead of one-indexed) source code
> locations for ‘read-error’. Here’s a 3.0.6/3.0.5 comparison:
>
> $ /gnu/store/r2nr74rwhpqg16y1lyi6l0jn3lwx4yyz-guile-3.0.6/bin/guile <(echo '(')
> ice-9/read.scm:126:4: In procedure lp:
> /dev/fd/63:1:0: unexpected end of input while searching for: )
> $ guile <(echo '(')
> ERROR: In procedure primitive-load:
> In procedure scm_i_lreadparen: /dev/fd/63:2:1: end of file
Here’s a test case waiting to succeed! :-)
-rw-r--r-- | test-suite/tests/reader.test | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/test-suite/tests/reader.test b/test-suite/tests/reader.test index fad531b39..231e69553 100644 --- a/test-suite/tests/reader.test +++ b/test-suite/tests/reader.test @@ -212,6 +212,18 @@ (with-test-prefix "mismatching parentheses" + (pass-if-equal "read-error location" + '("foo.scm:3:1: unexpected end of input while searching for: ~A" #\)) + (catch 'read-error + (lambda () + ;; The missing closing paren error should be located on line 3, + ;; column 1 (one-indexed). + (call-with-input-string "\n (hi there!\n" + (lambda (port) + (set-port-filename! port "foo.scm") + (read port)))) + (lambda (key proc message args . _) + (cons message args)))) (pass-if-exception "opening parenthesis" exception:eof (read-string "(")) |