diff options
author | Matthias Benkard <code@mail.matthias.benkard.de> | 2008-03-03 17:30:46 +0100 |
---|---|---|
committer | Matthias Benkard <code@mail.matthias.benkard.de> | 2008-03-03 17:30:46 +0100 |
commit | 2e26057818b48da27a5355e2d2101cb8605b840f (patch) | |
tree | cfa916870cdc83e35a12dcabc4ae62c86b63fa2b /Lisp/tests.lisp | |
parent | 68041467b00a878bd7325bf2f385bd58de7a2a20 (diff) |
Implement ADD-METHOD :AFTER (OBJECTIVE-C-GENERIC-FUNCTION OBJECTIVE-C-METHOD).
darcs-hash:16207045b44287e0f3f332937d826d1cc6c44296
Diffstat (limited to 'Lisp/tests.lisp')
-rw-r--r-- | Lisp/tests.lisp | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/Lisp/tests.lisp b/Lisp/tests.lisp index f5344df..cd87823 100644 --- a/Lisp/tests.lisp +++ b/Lisp/tests.lisp @@ -26,7 +26,9 @@ #:primitive-invoke #:print-typespec-to-string #:nominally #:find-objc-meta-class #:objcl-object-backed-by-lisp-class-p - #:foreign-class-registered-p)) + #:foreign-class-registered-p + #:define-objective-c-method #:defobjcmethod + #:objective-c-generic-function #:objective-c-method)) (in-package #:mulk.objective-cl.tests) (in-root-suite) @@ -419,6 +421,20 @@ ;; Class initialisation. (is (not (foreign-class-registered-p class))) + ;; Method definition. + (is (eval `(defgeneric |foo:bar:stuff:do:| (a b c d e &rest f) + (:generic-function-class objective-c-generic-function) + (:method-class objective-c-method)))) + (is (eval `(define-objective-c-method |foo:bar:stuff:do:| :int + ((x ,class-name) + (y :int) + z + (a (eql t)) + (b number) + &rest rest) + (declare (ignore z rest)) + (+ y 150)))) + ;; Sanity checks. (is (typep class 'objective-c-class)) (setq instance (is (invoke (invoke class 'alloc) 'init))) @@ -427,6 +443,9 @@ ;; creation.) (is (foreign-class-registered-p class)) + ;; Method calls. + (is (= 170 (invoke instance :foo 150 :bar nil :stuff t :do 100))) + ;; Object identity preservation. (is (eql instance (invoke instance 'self))) |