Add guile test for %newobject

This commit is contained in:
William S Fulton 2022-08-15 19:56:31 +01:00
commit 748bad3db2
2 changed files with 19 additions and 0 deletions

View file

@ -0,0 +1,3 @@
(dynamic-call "scm_init_newobject1_module" (dynamic-link "./libnewobject1"))
(load "../schemerunme/newobject1.scm")

View 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)