Add guile test for %newobject
This commit is contained in:
parent
23ce0655a6
commit
748bad3db2
2 changed files with 19 additions and 0 deletions
3
Examples/test-suite/guile/newobject1_runme.scm
Normal file
3
Examples/test-suite/guile/newobject1_runme.scm
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
(dynamic-call "scm_init_newobject1_module" (dynamic-link "./libnewobject1"))
|
||||
(load "../schemerunme/newobject1.scm")
|
||||
|
||||
16
Examples/test-suite/schemerunme/newobject1.scm
Normal file
16
Examples/test-suite/schemerunme/newobject1.scm
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
(define-macro (check test)
|
||||
`(if (not ,test) (error "Error in test" ',test)))
|
||||
|
||||
(define foo1 (Foo-makeFoo))
|
||||
(check (= (Foo-fooCount) 1))
|
||||
|
||||
(define foo2 (Foo-makeMore foo1))
|
||||
(check (= (Foo-fooCount) 2))
|
||||
|
||||
(delete-Foo foo1)
|
||||
(check (= (Foo-fooCount) 1))
|
||||
|
||||
(delete-Foo foo2)
|
||||
(check (= (Foo-fooCount) 0))
|
||||
|
||||
(exit 0)
|
||||
Loading…
Add table
Add a link
Reference in a new issue