summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOlly Betts <olly@survex.com>2022-03-07 12:36:37 +1300
committerOlly Betts <olly@survex.com>2022-03-07 12:36:37 +1300
commit314df0f71e35dcfa5ea91cd2f0abcb6355858ab9 (patch)
tree4011415bbc261d217c79db5e122bbd03fc754024
parent70553f01dc04820d27268122c5f696bb5605f2cb (diff)
downloadswig-314df0f71e35dcfa5ea91cd2f0abcb6355858ab9.tar.gz
Fix rename_camel testcase to work for Go
-rw-r--r--Examples/test-suite/php/rename_camel_runme.php4
-rw-r--r--Examples/test-suite/rename_camel.i42
2 files changed, 21 insertions, 25 deletions
diff --git a/Examples/test-suite/php/rename_camel_runme.php b/Examples/test-suite/php/rename_camel_runme.php
index becd20d47..9aaeda01d 100644
--- a/Examples/test-suite/php/rename_camel_runme.php
+++ b/Examples/test-suite/php/rename_camel_runme.php
@@ -6,8 +6,8 @@ require "tests.php";
check::werror(true);
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::constants(array("Hello","Hi_there","Bye","See_you"));
+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::done();
diff --git a/Examples/test-suite/rename_camel.i b/Examples/test-suite/rename_camel.i
index 76d44b8a8..a3d6fad7d 100644
--- a/Examples/test-suite/rename_camel.i
+++ b/Examples/test-suite/rename_camel.i
@@ -5,7 +5,7 @@
%inline {
struct GeometryFactory {
- void createPointFromInternalCoord(int);
+ void createPointFromInternalCoord(int) {}
void BIG_METHOD(int) {}
};
@@ -34,28 +34,28 @@
// utitle is an alias for undercase.
%rename("%(utitle)s") UnderCase3;
-// 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") "";
+// This should change 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 .*") "";
+%rename("%(upper)s",regexmatch$parentNode$type="enum .*") "";
%inline
{
- int CamelCase(int);
- int camel_case_1(int);
- int camel_case_2(int);
- int camel_case_3(int);
+ void CamelCase(int) {}
+ void camel_case_1(int) {}
+ void camel_case_2(int) {}
+ void camel_case_3(int) {}
- int under_case(int);
- int UnderCase1(int);
- int UnderCase2(int);
- int UnderCase3(int);
+ void under_case(int) {}
+ void UnderCase1(int) {}
+ void UnderCase2(int) {}
+ void UnderCase3(int) {}
- int lowerCamelCase(int);
- int Lower_camel_case_1(int);
- int Lower_camel_case_2(int);
- int Lower_camel_case_3(int);
+ void lowerCamelCase(int) {}
+ void Lower_camel_case_1(int) {}
+ void Lower_camel_case_2(int) {}
+ void Lower_camel_case_3(int) {}
enum HelloEnum {
hello, hi_there
@@ -65,15 +65,11 @@
bye, see_you
};
- int import(int);
- int foo(int);
-
+ void import(int) {}
+ void foo(int) {}
}
%rename("%(lowercase)s",sourcefmt="%(regex:/GSL_(.*)/\\1/)s",%$isfunction) "";
%inline {
void GSL_Hello() {}
}
-
-
-