summaryrefslogtreecommitdiff
path: root/test-suite/tests/syncase.test
diff options
context:
space:
mode:
authorAndy Wingo <wingo@pobox.com>2011-04-11 23:30:52 +0200
committerAndy Wingo <wingo@pobox.com>2011-04-11 23:30:52 +0200
commit21c05db45b69f8a62b84c36abc86cb935fa967d7 (patch)
tree743df01da540e7fd628f54894e7d5fbe94b03996 /test-suite/tests/syncase.test
parent4db853d747ac115f799c93e2de93f5159ad84109 (diff)
parentc89b45299329d034875429804f18768c1ea96713 (diff)
downloadguile-21c05db45b69f8a62b84c36abc86cb935fa967d7.tar.gz
Merge remote branch 'origin/stable-2.0'
Conflicts: GUILE-VERSION test-suite/tests/srfi-4.test
Diffstat (limited to 'test-suite/tests/syncase.test')
-rw-r--r--test-suite/tests/syncase.test21
1 files changed, 20 insertions, 1 deletions
diff --git a/test-suite/tests/syncase.test b/test-suite/tests/syncase.test
index 5f4856791..6183df813 100644
--- a/test-suite/tests/syncase.test
+++ b/test-suite/tests/syncase.test
@@ -1,6 +1,6 @@
;;;; 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
;;;; modify it under the terms of the GNU Lesser General Public
@@ -68,6 +68,13 @@
((alist ((key val) ...))
(list '(key . val) ...))))
+(with-test-prefix "with-syntax"
+ (pass-if "definitions allowed in body"
+ (equal? (with-syntax ((a 23))
+ (define b #'a)
+ (syntax->datum b))
+ 23)))
+
(with-test-prefix "tail patterns"
(with-test-prefix "at the outermost level"
(pass-if "non-tail invocation"
@@ -220,3 +227,15 @@
(set! baz 50)
(equal? (+ baz qux)
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))))