File tree Expand file tree Collapse file tree 3 files changed +43
-5
lines changed Expand file tree Collapse file tree 3 files changed +43
-5
lines changed Original file line number Diff line number Diff line change @@ -66,6 +66,11 @@ def test_enums():
6666 include_dirs ,
6767 )
6868
69+ assert mod .Foo .MyEnum
70+ assert mod .Foo .MyEnum .B
71+ assert mod .Foo2 .MyEnum
72+ assert mod .Foo2 .MyEnum .D
73+
6974 foo = mod .Foo ()
7075 my_enum = mod .Foo .MyEnum
7176 assert "Testing Enum documentation." in my_enum .__doc__
Original file line number Diff line number Diff line change @@ -20,4 +20,13 @@ class Foo
2020 case MyEnum::C : return 3 ;
2121 }
2222 };
23- };
23+ };
24+
25+ namespace Foo2
26+ {
27+
28+ enum class MyEnum
29+ {
30+ A,C,D
31+ };
32+ };
Original file line number Diff line number Diff line change 33cdef extern from " enums.hpp" :
44 cdef cppclass Foo:
55
6- int enumToInt(MyEnum e)
6+ int enumToInt(Foo__MyEnum e)
7+
8+ cdef extern from " enums.hpp" :
9+ cdef cppclass Foo2:
10+ pass
11+
712
813cdef extern from " enums.hpp" namespace " Foo" :
914
10- cpdef enum class MyEnum " Foo::MyEnum" :
15+ cpdef enum Foo__MyEnum " Foo::MyEnum" :
1116 # wrap-attach:
1217 # Foo
1318 #
19+ # wrap-as:
20+ # MyEnum
21+ #
1422 # wrap-doc:
1523 # Testing Enum documentation.
1624 A
1725 B
1826 C
1927
20- cpdef enum class MyEnum2 " Foo::MyEnum2" :
28+ cpdef enum MyEnum2 " Foo::MyEnum2" :
2129 # wrap-attach:
2230 # Foo
2331 A
2432 B
25- C
33+ C
34+
35+ cdef extern from " enums.hpp" namespace " Foo2" :
36+
37+ cpdef enum Foo2__MyEnum " Foo2::MyEnum" :
38+ # wrap-attach:
39+ # Foo2
40+ #
41+ # wrap-as:
42+ # MyEnum
43+ #
44+ # wrap-doc:
45+ # This is a second enum in another namespace.
46+ A
47+ C
48+ D
49+
You can’t perform that action at this time.
0 commit comments