mirror of
https://github.com/open-goal/jak-project.git
synced 2024-10-20 21:27:52 -04:00
11a82bbf08
* support static pairs * also support strings * reorganize static stuff * add test * support inlined fields * add missing type check
29 lines
1.1 KiB
Common Lisp
29 lines
1.1 KiB
Common Lisp
(start-test "new-static-basic")
|
|
|
|
(deftype static-test-basic-type (basic)
|
|
((s8 int8)
|
|
(s16 int16)
|
|
(thing basic)
|
|
(thing-2 basic)
|
|
(thing-3 basic)
|
|
(thing-4 float)
|
|
(u64 uint64))
|
|
)
|
|
|
|
(define test-static-basic (new 'static 'static-test-basic-type :s8 -122 :s16 -23123 :thing-4 1.2 :u64 434343 :thing 'bean :thing-2 #t :thing-3 #f))
|
|
|
|
(expect-true (< (the int test-static-basic) (-> debug current))) ;; should be in debug segment?
|
|
(expect-true (> (the int test-static-basic) (-> debug base)))
|
|
|
|
(expect-true (= (-> test-static-basic s8) -122))
|
|
(expect-true (= (-> test-static-basic s16) -23123))
|
|
(expect-true (= (-> test-static-basic u64) 434343))
|
|
(expect-true (eq? (-> test-static-basic thing) 'bean))
|
|
(expect-true (eq? (-> test-static-basic thing-2) #t))
|
|
(expect-true (eq? (-> test-static-basic thing-3) #f))
|
|
(expect-true (neq? (-> test-static-basic thing) 'not-bean))
|
|
(expect-true (eq? (-> test-static-basic type symbol) 'static-test-basic-type))
|
|
(expect-true (eq? (-> test-static-basic type) static-test-basic-type))
|
|
(expect-true (eq? (-> test-static-basic thing-4) 1.2))
|
|
|
|
(finish-test) |