[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Guile-commits] 02/04: tests: Add read-syntax + syntax-source test.
From: |
Ludovic Courtès |
Subject: |
[Guile-commits] 02/04: tests: Add read-syntax + syntax-source test. |
Date: |
Mon, 7 Mar 2022 04:57:11 -0500 (EST) |
civodul pushed a commit to branch main
in repository guile.
commit c572b11f3d1e5c663ce28bfd1410df53b5019ff3
Author: Ludovic Courtès <ludo@gnu.org>
AuthorDate: Mon Mar 7 10:28:03 2022 +0100
tests: Add read-syntax + syntax-source test.
* test-suite/tests/reader.test ("read-syntax")["syntax-source"]: New
test.
---
test-suite/tests/reader.test | 16 ++++++++++++++--
1 file changed, 14 insertions(+), 2 deletions(-)
diff --git a/test-suite/tests/reader.test b/test-suite/tests/reader.test
index ad7c6d575..27daf6106 100644
--- a/test-suite/tests/reader.test
+++ b/test-suite/tests/reader.test
@@ -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)