1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-04-29 19:30:36 +02:00

tests: Add read-syntax + syntax-source test.

* test-suite/tests/reader.test ("read-syntax")["syntax-source"]: New
test.
This commit is contained in:
Ludovic Courtès 2022-03-07 10:28:03 +01:00
parent a1a1400c7c
commit c572b11f3d

View file

@ -1,6 +1,6 @@
;;;; reader.test --- Reader test. -*- coding: iso-8859-1; mode: scheme -*-
;;;;
;;;; Copyright (C) 1999,2001-2003,2007-2011,2013-2015,2020,2021
;;;; Copyright (C) 1999, 2001-2003, 2007-2011, 2013-2015, 2020-2022
;;;; Free Software Foundation, Inc.
;;;;
;;;; Jim Blandy <jimb@red-bean.com>
@ -554,7 +554,19 @@
(with-test-prefix "read-syntax"
(pass-if-equal "annotations" 'args
(syntax-expression (call-with-input-string "( . args)" read-syntax))))
(syntax-expression (call-with-input-string "( . args)"
read-syntax)))
(pass-if-equal "syntax-source"
'((filename . "sample.scm") (line . 2) (column . 3))
(syntax-source
(call-with-input-string "\
;; first line
;; second line
(this is an expression)"
(lambda (port)
(set-port-filename! port "sample.scm")
(read-syntax port))))))
;;; Local Variables:
;;; eval: (put 'with-read-options 'scheme-indent-function 1)