[uim-commit] r982 - branches/r5rs/sigscheme/test
kzk at freedesktop.org
kzk at freedesktop.org
Wed Jul 20 05:28:18 EST 2005
Author: kzk
Date: 2005-07-19 12:28:09 -0700 (Tue, 19 Jul 2005)
New Revision: 982
Modified:
branches/r5rs/sigscheme/test/test-equation.scm
Log:
* sigscheme/test/test-equation.scm
- merge test cases for eqv? reported by oxy
Modified: branches/r5rs/sigscheme/test/test-equation.scm
===================================================================
--- branches/r5rs/sigscheme/test/test-equation.scm 2005-07-19 13:29:19 UTC (rev 981)
+++ branches/r5rs/sigscheme/test/test-equation.scm 2005-07-19 19:28:09 UTC (rev 982)
@@ -1,26 +1,47 @@
(load "test/unittest.scm")
-
;; check eqv?
-(assert "check both #t" (eqv? #t #t))
-(assert "check both #f" (eqv? #f #f))
-(assert "check symbol" (string=? (symbol->string 'obj)
- (symbol->string 'obj)))
-(assert "check num" (eqv? 10 10))
-(assert "check alphabet char" (eqv? #\a #\a))
-(assert "check hiragana char" (eqv? #\¤¢ #\¤¢))
+(assert "eqv? #1" (eqv? #t #t))
+(assert "eqv? #2" (eqv? #f #f))
+(assert "eqv? #3" (eqv? 'abc 'abc))
+(assert "eqv? #3" (string=? (symbol->string 'obj)
+ (symbol->string 'obj)))
+(assert "eqv? #4" (eqv? -1 -1))
+(assert "eqv? #4" (eqv? 0 0))
+(assert "eqv? #5" (eqv? #\a #\a))
+(assert "eqv? #5" (eqv? #\¤¢ #\¤¢))
-(assert-eq? "check empty list" '() '())
+(let ((f (lambda (x) x + 1)))
+ (assert "eqv? #6" (eqv? f f)))
+(let ((f (lambda (x) x + 1))
+ (g (lambda (x) x + 2)))
+ (assert "eqv? #6" (not (eqv? f g))))
+(let ((s1 "abc")
+ (s2 "abc"))
+ (assert "eqv? #6" (not (eqv? s1 s2))))
+(assert "eqv? #6" (not (eqv? (cons 1 2) (cons 1 2))))
+(assert "eqv? #6" (not (eqv? #f 'nil)))
+(assert "eqv? #7" (not (eqv? #t #f)))
+(assert "eqv? #7" (not (eqv? "abc" 'abc)))
+(assert "eqv? #7" (not (eqv? 'ab 'ba)))
+(assert "eqv? #7" (not (eqv? #\a #\b)))
+(assert "eqv? #7" (not (eqv? #\¤¢ #\¤¤)))
+(assert "eqv? #7" (not (eqv? '() '(())
+ )))
+
+;; check eq?
+(assert-eq? "eq? check empty list" '() '())
+
(define pair1 (cons 'a 'b))
(define pair2 pair1)
-(assert-eq? "check cons" pair1 pair2)
+(assert-eq? "eq? check cons" pair1 pair2)
(define str1 (string #\a))
(define str2 str1)
-(assert-eq? "check cons" str1 str2)
+(assert-eq? "eq? check cons" str1 str2)
-(assert-eq? "check func" + +)
+(assert-eq? "eq? check func" + +)
;; check equal?
(assert "basic equal? test1" (equal? 'a 'a))
More information about the uim-commit
mailing list