Add support for "[not]regexmatch" and "regextarget" to %rename.
"regexmatch" and "notregexmatch" can be used with anonymous %renames in the same way as "match" and "notmatch" while "regextarget" specifies that the argument of a non-anonymous %rename should be interpreted as a regular expression. Document the new functions. Also add a new unit test for %regex also testing regexmatch &c and provide test code for C# and Java verifying that it works as intended. git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12174 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
48a2e0bdea
commit
70c5bb5a47
7 changed files with 216 additions and 8 deletions
26
Examples/test-suite/java/rename_pcre_enum_runme.java
Normal file
26
Examples/test-suite/java/rename_pcre_enum_runme.java
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
import rename_pcre_enum.*;
|
||||
|
||||
public class rename_pcre_enum_runme {
|
||||
static { System.loadLibrary("rename_pcre_enum"); }
|
||||
|
||||
public static void main(String argv[])
|
||||
{
|
||||
Foo foo = Foo.First;
|
||||
if ( foo == Foo.Second )
|
||||
throw new RuntimeException("Enum values should be different");
|
||||
|
||||
// Check that Foo_Max enum element was ignored.
|
||||
int numFooEnumElements = Foo.values().length;
|
||||
if ( numFooEnumElements != 2 )
|
||||
throw new RuntimeException(String.format("Enum should have 2 elements, not %d",
|
||||
numFooEnumElements));
|
||||
|
||||
BoundaryCondition bc = BoundaryCondition.MaxMax;
|
||||
if ( bc.ordinal() != 2 )
|
||||
throw new RuntimeException("Wrong enum value");
|
||||
|
||||
Colour c = Colour.red;
|
||||
if ( c == Colour.blue )
|
||||
throw new RuntimeException("Enum values should be different");
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue