Fix and expand rename_camel.i testcase
The regex pattern to upper-case things containing an `i` had incorrect escaping (`\\(`...`\\)` instead of `(`...`)`) so `import` didn't get renamed. This wasn't detected because there were no `_runme` files for this testcase, so add rename_camel_runme.php which uses reflection to check the wrapped PHP classes, functions and constants are all named as expected. Also expand coverage of converting to underscore case and add coverage for converting to lower-camel-case. Related to #1041.
This commit is contained in:
parent
e1bb265bf7
commit
cf7bdcf2df
3 changed files with 64 additions and 12 deletions
|
|
@ -4,47 +4,62 @@
|
|||
%rename("%(ctitle)s",%$isvariable,%$ismember) "";
|
||||
|
||||
%inline {
|
||||
struct GeometryFactory
|
||||
{
|
||||
struct GeometryFactory {
|
||||
void createPointFromInternalCoord(int);
|
||||
void BIG_METHOD(int);
|
||||
void BIG_METHOD(int) {}
|
||||
};
|
||||
|
||||
class ByteOrderValues {
|
||||
|
||||
public:
|
||||
void readHEX();
|
||||
void readHEX() {}
|
||||
static int ENDIAN_BIG;
|
||||
};
|
||||
|
||||
int ByteOrderValues::ENDIAN_BIG = 4321;
|
||||
}
|
||||
|
||||
|
||||
%rename(CamelCase1) camel_case_1;
|
||||
%rename("%(camelcase)s") camel_case_2;
|
||||
// ctitle is an alias for camelcase.
|
||||
%rename("%(ctitle)s") camel_case_3;
|
||||
|
||||
%rename(lowerCamelCase1) Lower_camel_case_1;
|
||||
%rename("%(lowercamelcase)s") Lower_camel_case_2;
|
||||
// lctitle is an alias for lowercamelcase.
|
||||
%rename("%(lctitle)s") Lower_camel_case_3;
|
||||
|
||||
%rename("%(utitle)s") CamelCase_5;
|
||||
%rename(under_case1) UnderCase1;
|
||||
%rename("%(undercase)s") UnderCase2;
|
||||
// utitle is an alias for undercase.
|
||||
%rename("%(utitle)s") UnderCase3;
|
||||
|
||||
%rename("%(regex:/\\(.*i.*\\)/\\U\\1/)s") "";
|
||||
// This should upper-case "import", but "hi_there" should be handled by the
|
||||
// rule below and become "Hi_there".
|
||||
%rename("%(regex:/(.*i.*)/\\U\\1/)s") "";
|
||||
|
||||
%rename("%(title)s",regexmatch$parentNode$type="enum .*") "";
|
||||
|
||||
%inline
|
||||
{
|
||||
int CamelCase(int);
|
||||
int camel_case_1(int);
|
||||
int camel_case_2(int);
|
||||
int camel_case_3(int);
|
||||
int camel_case_4(int);
|
||||
int camel_case(int);
|
||||
int CamelCase_5(int);
|
||||
int also_works_here(int);
|
||||
|
||||
int under_case(int);
|
||||
int UnderCase1(int);
|
||||
int UnderCase2(int);
|
||||
int UnderCase3(int);
|
||||
|
||||
int lowerCamelCase(int);
|
||||
int Lower_camel_case_1(int);
|
||||
int Lower_camel_case_2(int);
|
||||
int Lower_camel_case_3(int);
|
||||
|
||||
enum HelloEnum {
|
||||
hello, hi_there
|
||||
};
|
||||
|
||||
|
||||
enum ChaoEnum {
|
||||
bye, see_you
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue