[uim-commit] r1767 - branches/r5rs/sigscheme/test
yamaken at freedesktop.org
yamaken at freedesktop.org
Mon Oct 3 04:08:34 PDT 2005
Author: yamaken
Date: 2005-10-03 04:08:31 -0700 (Mon, 03 Oct 2005)
New Revision: 1767
Modified:
branches/r5rs/sigscheme/test/test-eval.scm
Log:
* test-eval.scm
- Insert copyright header
- Replace SigScheme-dependent '() with (interaction-environment)
- Add some tests
Modified: branches/r5rs/sigscheme/test/test-eval.scm
===================================================================
--- branches/r5rs/sigscheme/test/test-eval.scm 2005-10-03 11:00:12 UTC (rev 1766)
+++ branches/r5rs/sigscheme/test/test-eval.scm 2005-10-03 11:08:31 UTC (rev 1767)
@@ -1,8 +1,52 @@
-(load "test/unittest.scm")
+;; FileName : test-eval.scm
+;; About : unit test for evaluation
+;;
+;; Copyright (C) 2005 by Kazuki Ohta (mover at hct.zaq.ne.jp)
+;;
+;; All rights reserved.
+;;
+;; Redistribution and use in source and binary forms, with or without
+;; modification, are permitted provided that the following conditions
+;; are met:
+;;
+;; 1. Redistributions of source code must retain the above copyright
+;; notice, this list of conditions and the following disclaimer.
+;; 2. Redistributions in binary form must reproduce the above copyright
+;; notice, this list of conditions and the following disclaimer in the
+;; documentation and/or other materials provided with the distribution.
+;; 3. Neither the name of authors nor the names of its contributors
+;; may be used to endorse or promote products derived from this software
+;; without specific prior written permission.
+;;
+;; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS
+;; IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+;; THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+;; PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR
+;; CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+;; EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+;; PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+;; PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+;; LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+;; NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+;; SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+(load "./test/unittest.scm")
+
;; check eval
-(assert-equal? "eval check" 3 (eval '(+ 1 2) '()))
+(assert-equal? "eval #1" 3 (eval '(+ 1 2)
+ (interaction-environment)))
-(assert-equal? "eval check" 3 (eval '((lambda (x y) (+ x y)) 1 2) '()))
+(assert-equal? "eval #2" 3 (eval '((lambda (x y) (+ x y)) 1 2)
+ (interaction-environment)))
+;; invalid environment specifiers
+(assert-error "eval #3" (lambda ()
+ (eval '(+ 1 2) 3)))
+(assert-error "eval #4" (lambda ()
+ (eval '(+ 1 2) 'symbol)))
+(assert-error "eval #5" (lambda ()
+ (eval '(+ 1 2) "string")))
+(assert-error "eval #6" (lambda ()
+ (eval '(+ 1 2) #\a)))
+
(total-report)
More information about the uim-commit
mailing list