1 ;;;; srcprop.test --- test Guile source properties -*- scheme -*-
3 ;;;; Copyright (C) 2003, 2006 Free Software Foundation, Inc.
5 ;;;; This library is free software; you can redistribute it and/or
6 ;;;; modify it under the terms of the GNU Lesser General Public
7 ;;;; License as published by the Free Software Foundation; either
8 ;;;; version 2.1 of the License, or (at your option) any later version.
10 ;;;; This library is distributed in the hope that it will be useful,
11 ;;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
12 ;;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 ;;;; Lesser General Public License for more details.
15 ;;;; You should have received a copy of the GNU Lesser General Public
16 ;;;; License along with this library; if not, write to the Free Software
17 ;;;; Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19 (define-module (test-suite test-srcprop)
20 :use-module (test-suite lib))
27 (with-test-prefix "source-properties"
30 (null? (source-properties (list 1 2 3))))
32 (read-enable 'positions)
33 (let ((s (read (open-input-string "(1 . 2)"))))
35 (pass-if "read properties"
36 (not (null? (source-properties s))))))
39 ;;; set-source-properties!
42 (with-test-prefix "set-source-properties!"
43 (read-enable 'positions)
44 (let ((s (read (open-input-string "(1 . 2)"))))
46 (with-test-prefix "copied props"
47 (pass-if "visible to source-property"
49 (set-source-properties! t (source-properties s))
50 (number? (source-property t 'line))))
52 (pass-if "visible to source-properties"
54 (set-source-properties! t (source-properties s))
55 (not (null? (source-properties t))))))))