mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-04-30 03:40:34 +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:
parent
a1a1400c7c
commit
c572b11f3d
1 changed files with 14 additions and 2 deletions
|
@ -1,6 +1,6 @@
|
||||||
;;;; reader.test --- Reader test. -*- coding: iso-8859-1; mode: scheme -*-
|
;;;; 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.
|
;;;; Free Software Foundation, Inc.
|
||||||
;;;;
|
;;;;
|
||||||
;;;; Jim Blandy <jimb@red-bean.com>
|
;;;; Jim Blandy <jimb@red-bean.com>
|
||||||
|
@ -554,7 +554,19 @@
|
||||||
|
|
||||||
(with-test-prefix "read-syntax"
|
(with-test-prefix "read-syntax"
|
||||||
(pass-if-equal "annotations" 'args
|
(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:
|
;;; Local Variables:
|
||||||
;;; eval: (put 'with-read-options 'scheme-indent-function 1)
|
;;; eval: (put 'with-read-options 'scheme-indent-function 1)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue