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:
Vadim Zeitlin 2010-07-22 17:00:59 +00:00
commit 0b2561f300
3 changed files with 30 additions and 0 deletions

View file

@ -284,6 +284,7 @@ CPP_TEST_CASES += \
rename4 \
rename_scope \
rename_strip_encoder \
rename_pcre_encoder \
restrict_cplusplus \
return_const_value \
return_value_scope \

View file

@ -0,0 +1,8 @@
from rename_pcre_encoder import *
s = SomeWidget()
a = AnotherWidget()
a.DoSomething()
evt = wxEVTSomeEvent()
t = xUnchangedName()

View 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 {
};
%}