Skip to content

Commit

Permalink
Added some tests. Implementing lists/pairs but not completed.
Browse files Browse the repository at this point in the history
  • Loading branch information
Gabriano committed Jul 4, 2012
1 parent 61e7f96 commit 085fb69
Show file tree
Hide file tree
Showing 10 changed files with 482 additions and 73 deletions.
431 changes: 360 additions & 71 deletions gsc/_t-univ.scm

Large diffs are not rendered by default.

29 changes: 29 additions & 0 deletions gsc/tests/7-char/and.scm
@@ -0,0 +1,29 @@
(declare (extended-bindings))

(define c1 #\A)
(define c2 #\B)

(define (test2 x y)
(println (and x y))
(println (if (and x y) 11 22))
(println (and (##not x) y))
(println (if (and (##not x) y) 11 22))
(println (and x (##not y)))
(println (if (and x (##not y)) 11 22))
(println (and (##not x) (##not y)))
(println (if (and (##not x) (##not y)) 11 22))
(println (##not (and x y)))
(println (if (##not (and x y)) 11 22))
(println (##not (and (##not x) y)))
(println (if (##not (and (##not x) y)) 11 22))
(println (##not (and x (##not y))))
(println (if (##not (and x (##not y))) 11 22))
(println (##not (and (##not x) (##not y))))
(println (if (##not (and (##not x) (##not y))) 11 22)))

(define (test x)
(test2 x c1)
(test2 x c2))

(test c1)
(test c2)
10 changes: 10 additions & 0 deletions gsc/tests/7-char/charp.scm
@@ -0,0 +1,10 @@
(declare (extended-bindings) (not safe))

(define c1 #\A)
(define notchar 42)

(define (test x)
(println (##char? x)))

(test c1)
(test notchar)
15 changes: 15 additions & 0 deletions gsc/tests/7-char/eq.scm
@@ -0,0 +1,15 @@
(declare (extended-bindings))

(define c1 #\A)
(define c2 #\B)

(define (test2 x y)
(println (##eq? x y))
(println (if (##eq? x y) 11 22)))

(define (test x)
(test2 x c1)
(test2 x c2))

(test c1)
(test c2)
10 changes: 10 additions & 0 deletions gsc/tests/7-char/if.scm
@@ -0,0 +1,10 @@
(declare (extended-bindings))

(define c1 #\A)
(define c2 #\B)

(define (test x)
(println (if x 11 22)))

(test c1)
(test c2)
10 changes: 10 additions & 0 deletions gsc/tests/7-char/not.scm
@@ -0,0 +1,10 @@
(declare (extended-bindings))

(define c1 #\A)
(define c2 #\B)

(define (test x)
(println (if (##not x) 11 22)))

(test c1)
(test c2)
29 changes: 29 additions & 0 deletions gsc/tests/7-char/or.scm
@@ -0,0 +1,29 @@
(declare (extended-bindings))

(define c1 #\A)
(define c2 #\B)

(define (test2 x y)
(println (or x y))
(println (if (or x y) 11 22))
(println (or (##not x) y))
(println (if (or (##not x) y) 11 22))
(println (or x (##not y)))
(println (if (or x (##not y)) 11 22))
(println (or (##not x) (##not y)))
(println (if (or (##not x) (##not y)) 11 22))
(println (##not (or x y)))
(println (if (##not (or x y)) 11 22))
(println (##not (or (##not x) y)))
(println (if (##not (or (##not x) y)) 11 22))
(println (##not (or x (##not y))))
(println (if (##not (or x (##not y))) 11 22))
(println (##not (or (##not x) (##not y))))
(println (if (##not (or (##not x) (##not y))) 11 22)))

(define (test x)
(test2 x c1)
(test2 x c2))

(test c1)
(test c2)
2 changes: 2 additions & 0 deletions gsc/tests/7-char/println.scm
@@ -0,0 +1,2 @@
(println #\A)
(println #\B)
15 changes: 15 additions & 0 deletions gsc/tests/8-charprim/char.scm
@@ -0,0 +1,15 @@
(declare (extended-bindings))

(define f (##not 123))
(define t (##not f))
(define c #\A)

(define (test x)
(println (##char? x))
(println (if (##char? x) 11 22)))

(test 0)
(test 1)
(test f)
(test t)
(test c)
4 changes: 2 additions & 2 deletions include/stamp.h
Expand Up @@ -2,5 +2,5 @@
* Time stamp of last source code repository commit.
*/

#define ___STAMP_YMD 20120612
#define ___STAMP_HMS 162147
#define ___STAMP_YMD 20120704
#define ___STAMP_HMS 202448

0 comments on commit 085fb69

Please sign in to comment.