mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-06-06 04:00:26 +02:00
add syncase test
* test-suite/tests/syncase.test ("top-level expansions"): New test.
This commit is contained in:
parent
4da326f25d
commit
fa3df855e8
1 changed files with 13 additions and 1 deletions
|
@ -1,6 +1,6 @@
|
||||||
;;;; syncase.test --- test suite for (ice-9 syncase) -*- scheme -*-
|
;;;; syncase.test --- test suite for (ice-9 syncase) -*- scheme -*-
|
||||||
;;;;
|
;;;;
|
||||||
;;;; Copyright (C) 2001, 2006, 2009, 2010 Free Software Foundation, Inc.
|
;;;; Copyright (C) 2001, 2006, 2009, 2010, 2011 Free Software Foundation, Inc.
|
||||||
;;;;
|
;;;;
|
||||||
;;;; This library is free software; you can redistribute it and/or
|
;;;; This library is free software; you can redistribute it and/or
|
||||||
;;;; modify it under the terms of the GNU Lesser General Public
|
;;;; modify it under the terms of the GNU Lesser General Public
|
||||||
|
@ -220,3 +220,15 @@
|
||||||
(set! baz 50)
|
(set! baz 50)
|
||||||
(equal? (+ baz qux)
|
(equal? (+ baz qux)
|
||||||
100)))))
|
100)))))
|
||||||
|
|
||||||
|
(with-test-prefix "top-level expansions"
|
||||||
|
(pass-if "syntax definitions expanded before other expressions"
|
||||||
|
(eval '(begin
|
||||||
|
(define even?
|
||||||
|
(lambda (x)
|
||||||
|
(or (= x 0) (odd? (- x 1)))))
|
||||||
|
(define-syntax odd?
|
||||||
|
(syntax-rules ()
|
||||||
|
((odd? x) (not (even? x)))))
|
||||||
|
(even? 10))
|
||||||
|
(current-module))))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue