summaryrefslogtreecommitdiffstats
path: root/test/src
diff options
context:
space:
mode:
authorDavid Snopek <dsnopek@gmail.com>2024-09-06 17:24:07 -0500
committerDavid Snopek <dsnopek@gmail.com>2024-09-18 13:24:56 -0500
commit536ea8561e00b8d6183ddc522476dd232c1d3bef (patch)
tree7f701d5b287b2eafe491b18a237805474342174f /test/src
parentd47758910428242169ebe59329b449edf16036e0 (diff)
downloadredot-cpp-536ea8561e00b8d6183ddc522476dd232c1d3bef.tar.gz
Allow unicode class names
Diffstat (limited to 'test/src')
-rw-r--r--test/src/example.cpp8
-rw-r--r--test/src/example.h10
-rw-r--r--test/src/register_types.cpp1
3 files changed, 19 insertions, 0 deletions
diff --git a/test/src/example.cpp b/test/src/example.cpp
index 8075f55..ab85e22 100644
--- a/test/src/example.cpp
+++ b/test/src/example.cpp
@@ -736,3 +736,11 @@ ExampleRuntime::ExampleRuntime() {
ExampleRuntime::~ExampleRuntime() {
}
+
+void ExamplePrzykład::_bind_methods() {
+ ClassDB::bind_method(D_METHOD("get_the_word"), &ExamplePrzykład::get_the_word);
+}
+
+String ExamplePrzykład::get_the_word() const {
+ return U"słowo to przykład";
+}
diff --git a/test/src/example.h b/test/src/example.h
index 6d88cf1..6d31ca5 100644
--- a/test/src/example.h
+++ b/test/src/example.h
@@ -273,4 +273,14 @@ public:
~ExampleRuntime();
};
+class ExamplePrzykład : public RefCounted {
+ GDCLASS(ExamplePrzykład, RefCounted);
+
+protected:
+ static void _bind_methods();
+
+public:
+ String get_the_word() const;
+};
+
#endif // EXAMPLE_CLASS_H
diff --git a/test/src/register_types.cpp b/test/src/register_types.cpp
index 7cfe689..d9290c8 100644
--- a/test/src/register_types.cpp
+++ b/test/src/register_types.cpp
@@ -30,6 +30,7 @@ void initialize_example_module(ModuleInitializationLevel p_level) {
GDREGISTER_CLASS(ExampleBase);
GDREGISTER_CLASS(ExampleChild);
GDREGISTER_RUNTIME_CLASS(ExampleRuntime);
+ GDREGISTER_CLASS(ExamplePrzykład);
}
void uninitialize_example_module(ModuleInitializationLevel p_level) {