diff options
author | John Lenz <jlenz2@math.uiuc.edu> | 2005-04-07 00:39:28 +0000 |
---|---|---|
committer | John Lenz <jlenz2@math.uiuc.edu> | 2005-04-07 00:39:28 +0000 |
commit | 56ac2ae4b11ad213f23fcc9a5c33d5e57399b38e (patch) | |
tree | cffcb8c835313ffc6523eb12609fc0b87f154cd0 /Examples/test-suite/chicken/overload_simple_runme_proxy.ss | |
parent | 211ddefb74a995f467ce71b062425ae18c0dde52 (diff) | |
download | swig-56ac2ae4b11ad213f23fcc9a5c33d5e57399b38e.tar.gz |
Add some chicken test-suite entries for overloaded functions
(which now work correctly) and update the chicken documentation
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@7146 626c5289-ae23-0410-ae9c-e8d60b6d4f22
Diffstat (limited to 'Examples/test-suite/chicken/overload_simple_runme_proxy.ss')
-rw-r--r-- | Examples/test-suite/chicken/overload_simple_runme_proxy.ss | 38 |
1 files changed, 30 insertions, 8 deletions
diff --git a/Examples/test-suite/chicken/overload_simple_runme_proxy.ss b/Examples/test-suite/chicken/overload_simple_runme_proxy.ss index 9c401f556..fa58f267e 100644 --- a/Examples/test-suite/chicken/overload_simple_runme_proxy.ss +++ b/Examples/test-suite/chicken/overload_simple_runme_proxy.ss @@ -1,24 +1,46 @@ +(require 'tinyclos) +(load "../../../Lib/chicken/multi-generic.scm") (load-library 'overload_simple "overload_simple.so") (define-macro (check test) - `(if (not ,test) (error ,'test))) + `(if (not ,test) (error ',test))) +(check (string=? (foo) "foo:")) (check (string=? (foo 3) "foo:int")) -(exit 0) (check (string=? (foo 3.01) "foo:double")) (check (string=? (foo "hey") "foo:char *")) (define f (make <Foo>)) (define b (make <Bar>)) -(define s (make <Spam>)) +(define b2 (make <Bar> 3)) + +(check (= (slot-ref b 'num) 0)) +(check (= (slot-ref b2 'num) 3)) (check (string=? (foo f) "foo:Foo *")) (check (string=? (foo b) "foo:Bar *")) +(check (string=? (foo f 3) "foo:Foo *,int")) +(check (string=? (foo 3.2 b) "foo:double,Bar *")) ;; now check blah (check (string=? (blah 2.01) "blah:double")) (check (string=? (blah "hey") "blah:char *")) +;; now check spam member functions +(define s (make <Spam>)) +(define s2 (make <Spam> 3)) +(define s3 (make <Spam> 3.2)) +(define s4 (make <Spam> "whee")) +(define s5 (make <Spam> f)) +(define s6 (make <Spam> b)) + +(check (string=? (slot-ref s 'type) "none")) +(check (string=? (slot-ref s2 'type) "int")) +(check (string=? (slot-ref s3 'type) "double")) +(check (string=? (slot-ref s4 'type) "char *")) +(check (string=? (slot-ref s5 'type) "Foo *")) +(check (string=? (slot-ref s6 'type) "Bar *")) + ;; now check Spam member functions (check (string=? (foo s 2) "foo:int")) (check (string=? (foo s 2.1) "foo:double")) @@ -27,10 +49,10 @@ (check (string=? (foo s b) "foo:Bar *")) ;; check static member funcs -(check (string=? (bar 3) "bar:int")) -(check (string=? (bar 3.2) "bar:double")) -(check (string=? (bar "hey") "bar:char *")) -(check (string=? (bar f) "bar:Foo *")) -(check (string=? (bar b) "bar:Bar *")) +(check (string=? (Spam-bar 3) "bar:int")) +(check (string=? (Spam-bar 3.2) "bar:double")) +(check (string=? (Spam-bar "hey") "bar:char *")) +(check (string=? (Spam-bar f) "bar:Foo *")) +(check (string=? (Spam-bar b) "bar:Bar *")) (exit 0) |