aboutsummaryrefslogtreecommitdiff
path: root/tests/Selector.m
diff options
context:
space:
mode:
authorArslaan Pathan <[email protected]>2026-10-03 23:04:55 +1300
committerArslaan Pathan <[email protected]>2026-10-03 23:04:55 +1300
commit9c8f390995ace83ebee758ba42fc7f77da2129e2 (patch)
treeeead5bdc7e57503287e91d9b41dcf9db83adcbad /tests/Selector.m
parent845aa9ce0bdbc64bc5890c719ae6016740836c0c (diff)
downloadParadox-9c8f390995ace83ebee758ba42fc7f77da2129e2.tar.xz
Paradox-9c8f390995ace83ebee758ba42fc7f77da2129e2.zip
Selector test and tweak Introspection (yay it works!)
Diffstat (limited to 'tests/Selector.m')
-rw-r--r--tests/Selector.m25
1 files changed, 25 insertions, 0 deletions
diff --git a/tests/Selector.m b/tests/Selector.m
new file mode 100644
index 0000000..0cc33e4
--- /dev/null
+++ b/tests/Selector.m
@@ -0,0 +1,25 @@
+#include <Paradox/Core.h>
+#include <stdio.h>
+
+@interface MyClass : PXObject
+- (void)sayHello;
+@end
+
+@implementation MyClass
+
+- (void)sayHello {
+ printf("Hello!\n");
+}
+
+@end
+
+int main(void) {
+ printf("Selector test\n");
+ MyClass *instance = [MyClass new];
+
+ printf("respondsToSelector:sayHello = %s\n", [instance respondsToSelector:@selector(sayHello)] ? "YES" : "NO");
+ printf("respondsToSelector:sayGoodbye = %s\n", [instance respondsToSelector:@selector(sayGoodbye)] ? "YES" : "NO");
+ printf("respondsToSelector:retain = %s\n", [instance respondsToSelector:@selector(retain)] ? "YES" : "NO");
+
+ [instance release];
+}