Add a test case for the regex encoder inside %rename.
Simple unit test checking that %rename("%(regex:...)") works as expected.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12171 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
c4e9043288
commit
0b2561f300
3 changed files with 30 additions and 0 deletions
|
|
@ -284,6 +284,7 @@ CPP_TEST_CASES += \
|
|||
rename4 \
|
||||
rename_scope \
|
||||
rename_strip_encoder \
|
||||
rename_pcre_encoder \
|
||||
restrict_cplusplus \
|
||||
return_const_value \
|
||||
return_value_scope \
|
||||
|
|
|
|||
8
Examples/test-suite/python/rename_pcre_encoder_runme.py
Normal file
8
Examples/test-suite/python/rename_pcre_encoder_runme.py
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
from rename_pcre_encoder import *
|
||||
|
||||
s = SomeWidget()
|
||||
a = AnotherWidget()
|
||||
a.DoSomething()
|
||||
|
||||
evt = wxEVTSomeEvent()
|
||||
t = xUnchangedName()
|
||||
21
Examples/test-suite/rename_pcre_encoder.i
Normal file
21
Examples/test-suite/rename_pcre_encoder.i
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
%module rename_pcre_encoder
|
||||
|
||||
// strip the wx prefix from all identifiers except those starting with wxEVT
|
||||
%rename("%(regex:/wx(?!EVT)(.*)/\\1/)s") "";
|
||||
|
||||
%inline %{
|
||||
|
||||
class wxSomeWidget {
|
||||
};
|
||||
|
||||
struct wxAnotherWidget {
|
||||
void wxDoSomething() {}
|
||||
};
|
||||
|
||||
class wxEVTSomeEvent {
|
||||
};
|
||||
|
||||
class xUnchangedName {
|
||||
};
|
||||
|
||||
%}
|
||||
Loading…
Add table
Add a link
Reference in a new issue