summaryrefslogtreecommitdiff
path: root/Lisp
diff options
context:
space:
mode:
authorMatthias Benkard <code@mail.matthias.benkard.de>2008-03-05 11:44:27 +0100
committerMatthias Benkard <code@mail.matthias.benkard.de>2008-03-05 11:44:27 +0100
commit353af3ac726399fe7e5534dc5bea7d999d00113b (patch)
treeca57b25e2ee98550772792fa32830c6f67b656c7 /Lisp
parent96ed1c189079219fd0772687839bfb4c7b7e3a27 (diff)
Add test cases for the new method syntax.
darcs-hash:79e19eb625c3afd8628733f0985bd4f26d104b06
Diffstat (limited to 'Lisp')
-rw-r--r--Lisp/tests.lisp20
1 files changed, 19 insertions, 1 deletions
diff --git a/Lisp/tests.lisp b/Lisp/tests.lisp
index 89593ca..cd138e5 100644
--- a/Lisp/tests.lisp
+++ b/Lisp/tests.lisp
@@ -29,7 +29,7 @@
#:foreign-class-registered-p
#:define-objective-c-method #:defobjcmethod
#:objective-c-generic-function #:objective-c-method
- #:+nil+ #:+yes+ #:+no+))
+ #:+nil+ #:+yes+ #:+no+ #:selector))
(in-package #:mulk.objective-cl.tests)
(in-root-suite)
@@ -370,6 +370,24 @@
#.(disable-objective-c-syntax)
+#.(enable-method-syntax)
+(deftest method-syntax ()
+ (is (eq '#/stringWithCString:encoding:
+ 'objective-c-selectors:|stringWithCString:encoding:|))
+ (is (fboundp '#/stringWithCString:encoding:))
+ (is (typep (fdefinition '#/stringWithCString:encoding:) 'selector))
+ (is (objc-equal (#/stringWithCString:encoding: (find-objc-class 'ns-string)
+ "Mulk."
+ 4)
+ (invoke (find-objc-class 'ns-string)
+ :string-with-c-string "Mulk." :encoding 4)))
+ (is (objc-equal (#/self (find-objc-class 'ns-array))
+ (find-objc-class 'ns-array)))
+ (is (subtypep (#/class (#/new (find-objc-class 'ns-mutable-array)))
+ (find-objc-class 'ns-mutable-array))))
+#.(disable-method-syntax)
+
+
(deftest compiler-macros ()
(flet ((compiler-macroexpand-1 (form &optional environment)
(funcall (or (compiler-macro-function (car form))