From 353af3ac726399fe7e5534dc5bea7d999d00113b Mon Sep 17 00:00:00 2001 From: Matthias Benkard Date: Wed, 5 Mar 2008 11:44:27 +0100 Subject: Add test cases for the new method syntax. darcs-hash:79e19eb625c3afd8628733f0985bd4f26d104b06 --- Lisp/tests.lisp | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) 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)) -- cgit v1.2.3