summary refs log tree commit diff stats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/cpp/enum.hpp3
-rw-r--r--tests/cpp/tenum_set.nim9
2 files changed, 12 insertions, 0 deletions
diff --git a/tests/cpp/enum.hpp b/tests/cpp/enum.hpp
new file mode 100644
index 000000000..268999d68
--- /dev/null
+++ b/tests/cpp/enum.hpp
@@ -0,0 +1,3 @@
+namespace namespaced {
+enum Enum { A, B, C };
+}
diff --git a/tests/cpp/tenum_set.nim b/tests/cpp/tenum_set.nim
new file mode 100644
index 000000000..6afed722f
--- /dev/null
+++ b/tests/cpp/tenum_set.nim
@@ -0,0 +1,9 @@
+discard """
+targets: "cpp"
+output: "{A, B, C}"
+"""
+
+type Enum {.importcpp: "namespaced::Enum", header: "enum.hpp".} = enum A, B, C
+
+var vals = {low(Enum) .. high(Enum)}
+echo vals