[uim-commit] r1790 - branches/r5rs/sigscheme/test

kzk at freedesktop.org kzk at freedesktop.org
Mon Oct 3 23:12:19 PDT 2005


Author: kzk
Date: 2005-10-03 23:12:17 -0700 (Mon, 03 Oct 2005)
New Revision: 1790

Modified:
   branches/r5rs/sigscheme/test/test-char.scm
   branches/r5rs/sigscheme/test/test-equation.scm
   branches/r5rs/sigscheme/test/test-list.scm
   branches/r5rs/sigscheme/test/test-quote.scm
   branches/r5rs/sigscheme/test/test-string.scm
   branches/r5rs/sigscheme/test/test-vector.scm
Log:
* test/test-quote.scm
* test/test-string.scm
* test/test-equation.scm
* test/test-vector.scm
* test/test-list.scm
* test/test-char.scm
  - use "assert-true" instead of "assert"


Modified: branches/r5rs/sigscheme/test/test-char.scm
===================================================================
--- branches/r5rs/sigscheme/test/test-char.scm	2005-10-04 00:21:29 UTC (rev 1789)
+++ branches/r5rs/sigscheme/test/test-char.scm	2005-10-04 06:12:17 UTC (rev 1790)
@@ -1,16 +1,16 @@
 (load "./test/unittest.scm")
 
 ;; check char?
-(assert "alphabet char" (char? #\a))
-(assert "space 1"       (char? #\space))
-(assert "space 2"       (char? #\ ))
-(assert "tab"           (char? #\	))
-(assert "newline 2"     (char? #\newline))
-(assert "newline 2"     (char? #\
+(assert-true "alphabet char" (char? #\a))
+(assert-true "space 1"       (char? #\space))
+(assert-true "space 2"       (char? #\ ))
+(assert-true "tab"           (char? #\	))
+(assert-true "newline 2"     (char? #\newline))
+(assert-true "newline 2"     (char? #\
 ))
-(assert "hiragana char" (char? #\¤¢))
-(assert "( char"        (char? #\())
-(assert ") char"        (char? #\)))
-(assert "\\ char"       (char? #\\))
+(assert-true "hiragana char" (char? #\¤¢))
+(assert-true "( char"        (char? #\())
+(assert-true ") char"        (char? #\)))
+(assert-true "\\ char"       (char? #\\))
 
 (total-report)

Modified: branches/r5rs/sigscheme/test/test-equation.scm
===================================================================
--- branches/r5rs/sigscheme/test/test-equation.scm	2005-10-04 00:21:29 UTC (rev 1789)
+++ branches/r5rs/sigscheme/test/test-equation.scm	2005-10-04 06:12:17 UTC (rev 1790)
@@ -4,33 +4,33 @@
 (define closure2 (lambda (x) x))
 
 ;; check 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)
+(assert-true"eqv? #1" (eqv? #t #t))
+(assert-true"eqv? #2" (eqv? #f #f))
+(assert-true"eqv? #3" (eqv? 'abc 'abc))
+(assert-true"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-true"eqv? #4" (eqv? -1 -1))
+(assert-true"eqv? #4" (eqv? 0 0))
+(assert-true"eqv? #5" (eqv? #\a #\a))
+(assert-true"eqv? #5" (eqv? #\¤¢ #\¤¢))
 
 (let ((f (lambda (x) x + 1)))
-  (assert "eqv? #6" (eqv? f f)))
+  (assert-true"eqv? #6" (eqv? f f)))
 (let ((f (lambda (x) x + 1))
       (g (lambda (x) x + 2)))
-  (assert "eqv? #6" (not (eqv? f g))))
+  (assert-true"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-true"eqv? #6" (not (eqv? s1 s2))))
+(assert-true"eqv? #6" (not (eqv? (cons 1 2) (cons 1 2))))
+(assert-true"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? '() '(())
+(assert-true"eqv? #7" (not (eqv? #t #f)))
+(assert-true"eqv? #7" (not (eqv? "abc" 'abc)))
+(assert-true"eqv? #7" (not (eqv? 'ab 'ba)))
+(assert-true"eqv? #7" (not (eqv? #\a #\b)))
+(assert-true"eqv? #7" (not (eqv? #\¤¢ #\¤¤)))
+(assert-true"eqv? #7" (not (eqv? '() '(())
 			          )))
 
 (assert-true  "eqv? #8 procedures" (eqv? + +))
@@ -64,13 +64,13 @@
 ;; TODO: add tests for port and continuation
 
 ;; check equal?
-(assert "basic equal? test1" (equal? 'a 'a))
-(assert "basic equal? test2" (equal? '(a) '(a)))
-(assert "basic equal? test3" (equal? '(a (b) c)
+(assert-true"basic equal? test1" (equal? 'a 'a))
+(assert-true"basic equal? test2" (equal? '(a) '(a)))
+(assert-true"basic equal? test3" (equal? '(a (b) c)
 				     '(a (b) c)))
-(assert "basic equal? test4" (equal? "abc" "abc"))
-(assert "basic equal? test5" (equal? 2 2))
-(assert "basic equal? test6" (equal? (make-vector 5 'a)
+(assert-true"basic equal? test4" (equal? "abc" "abc"))
+(assert-true"basic equal? test5" (equal? 2 2))
+(assert-true"basic equal? test6" (equal? (make-vector 5 'a)
 				     (make-vector 5 'a)))
 
 (assert-true  "equal? #3 procedures" (equal? + +))

Modified: branches/r5rs/sigscheme/test/test-list.scm
===================================================================
--- branches/r5rs/sigscheme/test/test-list.scm	2005-10-04 00:21:29 UTC (rev 1789)
+++ branches/r5rs/sigscheme/test/test-list.scm	2005-10-04 06:12:17 UTC (rev 1790)
@@ -46,8 +46,8 @@
 
 
 ; pair?
-(assert "pair? test1" (pair? '(a . b)))
-(assert "pair? test2" (pair? '(a b c)))
+(assert-true "pair? test1" (pair? '(a . b)))
+(assert-true "pair? test2" (pair? '(a b c)))
 (assert-equal? "pair? test3" #f (pair? '()))
 (assert-equal? "pair? test4" #f (pair? '#(a b)))
 
@@ -67,12 +67,12 @@
 (assert-equal? "cdr test2" 2 (cdr '(1 . 2)))
 
 ; null?
-(assert "null? test1" (null? '()))
+(assert-true "null? test1" (null? '()))
 (assert-equal? "null? test2" #f (null? "aiueo"))
 
 ; list?
-(assert "list? test1" (list? '(a b c)))
-(assert "list? test2" (list? '()))
+(assert-true "list? test1" (list? '(a b c)))
+(assert-true "list? test2" (list? '()))
 (assert-false "list? test3" (list? '(a . b)))
 (assert-false "list? test4" (list? '(a b . c)))
 (assert-false "list? test5" (let ((x (list 'a)))

Modified: branches/r5rs/sigscheme/test/test-quote.scm
===================================================================
--- branches/r5rs/sigscheme/test/test-quote.scm	2005-10-04 00:21:29 UTC (rev 1789)
+++ branches/r5rs/sigscheme/test/test-quote.scm	2005-10-04 06:12:17 UTC (rev 1790)
@@ -1,15 +1,15 @@
 (load "test/unittest.scm")
 
-(assert "quasiquote check" (equal? '(1 2 3) `(1 2 3)))
-(assert "unquote check" (equal? `(1 2 3) `(1 ,(+ 1 1) ,(+ 1 2))))
-(assert "unquote-splicing check" (equal? `(1 2 3) `(1 ,@(cdr '(1 2)) 3)))
-(assert "mixed check" (equal? '(a 3 c 7 8 9) `(a ,(+ 1 2) c ,@(cdr '(6 7 8 9)))))
-(assert "nested quasiquote check"
+(assert-true "quasiquote check" (equal? '(1 2 3) `(1 2 3)))
+(assert-true "unquote check" (equal? `(1 2 3) `(1 ,(+ 1 1) ,(+ 1 2))))
+(assert-true "unquote-splicing check" (equal? `(1 2 3) `(1 ,@(cdr '(1 2)) 3)))
+(assert-true "mixed check" (equal? '(a 3 c 7 8 9) `(a ,(+ 1 2) c ,@(cdr '(6 7 8 9)))))
+(assert-true "nested quasiquote check"
 	(equal?
 	 '(a `(b c ,() 0) 1)
 	 `(a `(b c ,(,@() ,@()) 0) 1)))
 
-(assert "vector quasiquote check"
+(assert-true "vector quasiquote check"
 	(equal?
 	 '#(#(a b c d) e)
 	 `#(,@() #(a ,@(list 'b 'c) d) e)))

Modified: branches/r5rs/sigscheme/test/test-string.scm
===================================================================
--- branches/r5rs/sigscheme/test/test-string.scm	2005-10-04 00:21:29 UTC (rev 1789)
+++ branches/r5rs/sigscheme/test/test-string.scm	2005-10-04 06:12:17 UTC (rev 1790)
@@ -1,12 +1,12 @@
 (load "./test/unittest.scm")
 
 ;; check string?
-(assert "string? check" (string? "aiueo"))
+(assert-true"string? check" (string? "aiueo"))
 
 ;; check make-string
-(assert "null make-string" (string? (make-string 6)))
-(assert "alphabet make-string check" (string=? "aaa" (make-string 3 #\a)))
-(assert "hiragana make-string check" (string=? "¤¢¤¢¤¢" (make-string 3 #\¤¢)))
+(assert-true"null make-string" (string? (make-string 6)))
+(assert-true"alphabet make-string check" (string=? "aaa" (make-string 3 #\a)))
+(assert-true"hiragana make-string check" (string=? "¤¢¤¢¤¢" (make-string 3 #\¤¢)))
 
 ;; check string-ref
 (assert-equal? "alphabet string-ref check" #\o  (string-ref "aiueo" 4))
@@ -16,17 +16,17 @@
 (assert-equal? "hiragena string-ref 0 check" #\¤¢ (string-ref "¤¢¤¤¤¦¤¨¤ª" 0))
 
 ;; check string-set!
-(assert "alphabet string-set! check" (string=? "aikeo"
+(assert-true"alphabet string-set! check" (string=? "aikeo"
 					       (begin
 						 (define str "aiueo")
 						 (string-set! str 2 #\k)
 						 str)))
-(assert "hiragana string-set! check" (string=? "¤¢¤¤¤«¤¨¤ª"
+(assert-true"hiragana string-set! check" (string=? "¤¢¤¤¤«¤¨¤ª"
 					       (begin
 						 (define str "¤¢¤¤¤¦¤¨¤ª")
 						 (string-set! str 2 #\¤«)
 						 str)))
-(assert "mixed string-set! check" (string=? "aiueo"
+(assert-true"mixed string-set! check" (string=? "aiueo"
 					    (begin
 					      (define str "ai¤¦eo")
 					      (string-set! str 2 #\u)
@@ -45,23 +45,23 @@
 (assert-equal? "mixed string=? check"    #t (string=? "a¤¤¤¦¤¨o" "a¤¤¤¦¤¨o"))
 
 ;; substring check
-(assert "alphabet substring check" (string=? "iu"   (substring "aiueo" 1 3)))
-(assert "hiragana substring check" (string=? "¤¤¤¦" (substring "¤¢¤¤¤¦¤¨¤ª" 1 3)))
-(assert "mixed substring check"    (string=? "¤¤u"  (substring "a¤¤u¤¨o" 1 3)))
+(assert-true"alphabet substring check" (string=? "iu"   (substring "aiueo" 1 3)))
+(assert-true"hiragana substring check" (string=? "¤¤¤¦" (substring "¤¢¤¤¤¦¤¨¤ª" 1 3)))
+(assert-true"mixed substring check"    (string=? "¤¤u"  (substring "a¤¤u¤¨o" 1 3)))
 
 
 ;; string-append check
-(assert "alphabet 1 string-append check" (string=? "a"   (string-append "a")))
-(assert "alphabet 2 string-append check" (string=? "ai"  (string-append "a" "i")))
-(assert "alphabet 3 string-append check" (string=? "aiu" (string-append "a" "i" "u")))
-(assert "hiragana 1 string-append check" (string=? "¤¢"     (string-append "¤¢")))
-(assert "hiragana 2 string-append check" (string=? "¤¢¤¤"   (string-append "¤¢" "¤¤")))
-(assert "hiragana 3 string-append check" (string=? "¤¢¤¤¤¦" (string-append "¤¢" "¤¤" "¤¦")))
-(assert "mixed 2 string-append check" (string=? "¤¢i"   (string-append "¤¢" "i")))
-(assert "mixed 3 string-append check" (string=? "¤¢i¤¦" (string-append "¤¢" "i" "¤¦")))
+(assert-true"alphabet 1 string-append check" (string=? "a"   (string-append "a")))
+(assert-true"alphabet 2 string-append check" (string=? "ai"  (string-append "a" "i")))
+(assert-true"alphabet 3 string-append check" (string=? "aiu" (string-append "a" "i" "u")))
+(assert-true"hiragana 1 string-append check" (string=? "¤¢"     (string-append "¤¢")))
+(assert-true"hiragana 2 string-append check" (string=? "¤¢¤¤"   (string-append "¤¢" "¤¤")))
+(assert-true"hiragana 3 string-append check" (string=? "¤¢¤¤¤¦" (string-append "¤¢" "¤¤" "¤¦")))
+(assert-true"mixed 2 string-append check" (string=? "¤¢i"   (string-append "¤¢" "i")))
+(assert-true"mixed 3 string-append check" (string=? "¤¢i¤¦" (string-append "¤¢" "i" "¤¦")))
 
 ;; string->list
-(assert "string->list check" (equal? '(#\¤¢ #\i #\¤¦ #\e #\¤ª) (string->list "¤¢i¤¦e¤ª")))
+(assert-true"string->list check" (equal? '(#\¤¢ #\i #\¤¦ #\e #\¤ª) (string->list "¤¢i¤¦e¤ª")))
 (assert-equal? "string->list check" '(#\\)             (string->list "\\"))
 (assert-equal? "string->list check" '(#\\ #\\)         (string->list "\\\\"))
 (assert-equal? "string->list check" '(#\\ #\\ #\\)     (string->list "\\\\\\"))
@@ -96,19 +96,19 @@
 (assert-equal? "list->string check" "\"a\"" (list->string '(#\" #\a #\")))
 
 ;; string-fill!
-(assert "alphabet string-fill! check" (string=? "jjjjj" (begin
+(assert-true"alphabet string-fill! check" (string=? "jjjjj" (begin
 							  (define str "aiueo")
 							  (string-fill! str #\j)
 							  str)))
-(assert "hiragana string-fill! check" (string=? "¤¢¤¢¤¢¤¢¤¢" (begin
+(assert-true"hiragana string-fill! check" (string=? "¤¢¤¢¤¢¤¢¤¢" (begin
 							       (define str "aiueo")
 							       (string-fill! str #\¤¢)
 							       str)))
-(assert "mixed string-fill! by alphabet check" (string=? "aaaaa" (begin
+(assert-true"mixed string-fill! by alphabet check" (string=? "aaaaa" (begin
 								   (define str "a¤¤¤¦¤¨o")
 								   (string-fill! str #\a)
 								   str)))
-(assert "mixed string-fill! by hiragana check" (string=? "¤¤¤¤¤¤¤¤¤¤" (begin
+(assert-true"mixed string-fill! by hiragana check" (string=? "¤¤¤¤¤¤¤¤¤¤" (begin
 									(define str "a¤¤¤¦¤¨o")
 									(string-fill! str #\¤¤)
 									str)))

Modified: branches/r5rs/sigscheme/test/test-vector.scm
===================================================================
--- branches/r5rs/sigscheme/test/test-vector.scm	2005-10-04 00:21:29 UTC (rev 1789)
+++ branches/r5rs/sigscheme/test/test-vector.scm	2005-10-04 06:12:17 UTC (rev 1790)
@@ -2,23 +2,23 @@
 
 (define vec (vector 'a 'b 'c 'd))
 
-(assert "vector test"  (equal? '#(a b c d) vec))
-(assert "vector? test" (vector? vec))
+(assert-true"vector test"  (equal? '#(a b c d) vec))
+(assert-true"vector? test" (vector? vec))
 (assert-equal? "vector-length test" 4 (vector-length vec))
 (assert-equal? "vector-ref test" 'd (vector-ref vec 3))
-(assert "vector-set! test" (equal? '#(1 a "aiue" #t) (begin
+(assert-true"vector-set! test" (equal? '#(1 a "aiue" #t) (begin
 							(define tmpvec (vector 1 'a "aiue" #f))
 							(vector-set! tmpvec 3 #t)
 							tmpvec)))
 
-(assert "vector->list test" (equal? '(a b c d) (vector->list vec)))
-(assert "list->vector test" (equal? '#(a b c d) (list->vector '(a b c d))))
-(assert "vector-fill! test" (equal? '#(#f #f #f #f) (begin
+(assert-true"vector->list test" (equal? '(a b c d) (vector->list vec)))
+(assert-true"list->vector test" (equal? '#(a b c d) (list->vector '(a b c d))))
+(assert-true"vector-fill! test" (equal? '#(#f #f #f #f) (begin
 						      (define tmpvec (vector #t #t #t #t))
 						      (vector-fill! tmpvec #f)
 						      tmpvec)))
 
 ;(print (make-vector 3))
-(assert "make-vector test" (equal? '#(#f #f #f) (make-vector 3 #f)))
+(assert-true"make-vector test" (equal? '#(#f #f #f) (make-vector 3 #f)))
 
 (total-report)



More information about the uim-commit mailing list