You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
31 lines
1.0 KiB
Racket
31 lines
1.0 KiB
Racket
8 years ago
|
#lang racket/base
|
||
|
|
||
3 years ago
|
(require yaragg/examples/01-equal
|
||
8 years ago
|
rackunit)
|
||
|
|
||
|
(check-equal? (syntax->datum (parse ""))
|
||
|
'(equal))
|
||
|
(check-equal? (syntax->datum (parse "01"))
|
||
7 years ago
|
'(equal (zero (equal) "0")
|
||
|
(one (equal) "1")))
|
||
8 years ago
|
(check-equal? (syntax->datum (parse "10"))
|
||
7 years ago
|
'(equal (one (equal) "1")
|
||
|
(zero (equal) "0")))
|
||
8 years ago
|
(check-equal? (syntax->datum (parse "0011"))
|
||
7 years ago
|
'(equal (zero (equal) "0")
|
||
|
(one (equal (zero (equal) "0")
|
||
|
(one (equal) "1"))
|
||
|
"1")))
|
||
8 years ago
|
(check-equal? (syntax->datum (parse "0110"))
|
||
7 years ago
|
'(equal (one (equal (zero (equal) "0")
|
||
|
(one (equal) "1"))
|
||
|
"1")
|
||
|
(zero (equal) "0")))
|
||
8 years ago
|
|
||
|
(check-equal? (syntax->datum (parse "1100"))
|
||
7 years ago
|
'(equal (one (equal) "1")
|
||
|
(zero (equal (one (equal) "1")
|
||
|
(zero (equal) "0"))
|
||
|
"0")))
|
||
8 years ago
|
|