Fix rename_camel testcase to work for Go
This commit is contained in:
parent
70553f01dc
commit
314df0f71e
2 changed files with 21 additions and 25 deletions
|
|
@ -6,8 +6,8 @@ require "tests.php";
|
||||||
check::werror(true);
|
check::werror(true);
|
||||||
|
|
||||||
check::classes(array("rename_camel","GeometryFactory","ByteOrderValues"));
|
check::classes(array("rename_camel","GeometryFactory","ByteOrderValues"));
|
||||||
check::functions(array("CamelCase","CamelCase1","CamelCase2","CamelCase3","lowerCamelCase","lowerCamelCase1","lowerCamelCase2","lowerCamelCase3","under_case","under_case1","under_case2","under_case3","IMPORT","foo","hello"));
|
check::functions(array("CamelCase","CamelCase1","CamelCase2","CamelCase3","lowerCamelCase","lowerCamelCase1","lowerCamelCase2","lowerCamelCase3","under_case","under_case1","under_case2","under_case3","Import","foo","hello"));
|
||||||
check::constants(array("Hello","Hi_there","Bye","See_you"));
|
check::constants(array("HELLO","HI_THERE","BYE","SEE_YOU"));
|
||||||
|
|
||||||
|
|
||||||
check::done();
|
check::done();
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@
|
||||||
|
|
||||||
%inline {
|
%inline {
|
||||||
struct GeometryFactory {
|
struct GeometryFactory {
|
||||||
void createPointFromInternalCoord(int);
|
void createPointFromInternalCoord(int) {}
|
||||||
void BIG_METHOD(int) {}
|
void BIG_METHOD(int) {}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -34,28 +34,28 @@
|
||||||
// utitle is an alias for undercase.
|
// utitle is an alias for undercase.
|
||||||
%rename("%(utitle)s") UnderCase3;
|
%rename("%(utitle)s") UnderCase3;
|
||||||
|
|
||||||
// This should upper-case "import", but "hi_there" should be handled by the
|
// This should change upper-case "import", but "hi_there" should be handled by the
|
||||||
// rule below and become "Hi_there".
|
// rule below and become "HI_THERE".
|
||||||
%rename("%(regex:/(.*i.*)/\\U\\1/)s") "";
|
%rename("%(regex:/(.*i.*)/\\u\\1/)s") "";
|
||||||
|
|
||||||
%rename("%(title)s",regexmatch$parentNode$type="enum .*") "";
|
%rename("%(upper)s",regexmatch$parentNode$type="enum .*") "";
|
||||||
|
|
||||||
%inline
|
%inline
|
||||||
{
|
{
|
||||||
int CamelCase(int);
|
void CamelCase(int) {}
|
||||||
int camel_case_1(int);
|
void camel_case_1(int) {}
|
||||||
int camel_case_2(int);
|
void camel_case_2(int) {}
|
||||||
int camel_case_3(int);
|
void camel_case_3(int) {}
|
||||||
|
|
||||||
int under_case(int);
|
void under_case(int) {}
|
||||||
int UnderCase1(int);
|
void UnderCase1(int) {}
|
||||||
int UnderCase2(int);
|
void UnderCase2(int) {}
|
||||||
int UnderCase3(int);
|
void UnderCase3(int) {}
|
||||||
|
|
||||||
int lowerCamelCase(int);
|
void lowerCamelCase(int) {}
|
||||||
int Lower_camel_case_1(int);
|
void Lower_camel_case_1(int) {}
|
||||||
int Lower_camel_case_2(int);
|
void Lower_camel_case_2(int) {}
|
||||||
int Lower_camel_case_3(int);
|
void Lower_camel_case_3(int) {}
|
||||||
|
|
||||||
enum HelloEnum {
|
enum HelloEnum {
|
||||||
hello, hi_there
|
hello, hi_there
|
||||||
|
|
@ -65,15 +65,11 @@
|
||||||
bye, see_you
|
bye, see_you
|
||||||
};
|
};
|
||||||
|
|
||||||
int import(int);
|
void import(int) {}
|
||||||
int foo(int);
|
void foo(int) {}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
%rename("%(lowercase)s",sourcefmt="%(regex:/GSL_(.*)/\\1/)s",%$isfunction) "";
|
%rename("%(lowercase)s",sourcefmt="%(regex:/GSL_(.*)/\\1/)s",%$isfunction) "";
|
||||||
%inline {
|
%inline {
|
||||||
void GSL_Hello() {}
|
void GSL_Hello() {}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue