public class RETest
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
(package private) REDebugCompiler |
compiler |
(package private) int |
failures |
(package private) static java.lang.String |
NEW_LINE |
(package private) static boolean |
showSuccesses |
(package private) int |
testCount |
Constructor and Description |
---|
RETest()
Constructor
|
Modifier and Type | Method and Description |
---|---|
void |
assertEquals(java.lang.String message,
int expected,
int actual) |
void |
assertEquals(java.lang.String message,
java.lang.String expected,
java.lang.String actual) |
(package private) void |
die(java.lang.String s)
Exit with a fatal error.
|
(package private) void |
fail(java.lang.String s)
Fail with an error.
|
(package private) void |
fail(java.lang.StringBuffer log,
java.lang.String s)
Fail with an error.
|
private java.lang.String |
findNextTest(java.io.BufferedReader br)
Finds next test description in a given script.
|
private boolean |
getExpectedResult(java.lang.String yesno)
Converts yesno string to boolean.
|
private RETestCase |
getNextTestCase(java.io.BufferedReader br)
Creates testcase for the next test description in the script file.
|
static void |
main(java.lang.String[] args)
Main program entrypoint.
|
(package private) void |
runAutomatedTests(java.lang.String testDocument)
Run automated tests in RETest.txt file (from Perl 4.0 test battery)
|
(package private) void |
runInteractiveTests(java.lang.String expr)
Compile and test matching against a single expression
|
(package private) void |
say(java.lang.String s)
Say something to standard out
|
(package private) void |
showParens(RE r)
Dump parenthesized subexpressions found by a regular expression matcher object
|
static boolean |
test(java.lang.String[] args)
Testing entrypoint.
|
(package private) void |
testOther()
Run automated unit test
|
private void |
testPrecompiledRE() |
private void |
testSplitAndGrep() |
private void |
testSubst() |
static final boolean showSuccesses
static final java.lang.String NEW_LINE
final REDebugCompiler compiler
int testCount
int failures
public static void main(java.lang.String[] args)
args
- Command line arguments (optional regular expression)public static boolean test(java.lang.String[] args) throws java.lang.Exception
args
- Command line argumentsjava.lang.Exception
- thrown in case of errorvoid runInteractiveTests(java.lang.String expr)
expr
- Expression to compile and testvoid die(java.lang.String s)
s
- Last famous words before exitingvoid fail(java.lang.StringBuffer log, java.lang.String s)
log
- Output before failures
- Failure descriptionvoid fail(java.lang.String s)
s
- Failure descriptionvoid say(java.lang.String s)
s
- What to sayvoid showParens(RE r)
r
- Matcher object with results to showvoid runAutomatedTests(java.lang.String testDocument) throws java.lang.Exception
java.lang.Exception
- thrown in case of errorvoid testOther() throws java.lang.Exception
java.lang.Exception
- thrown in case of errorprivate void testPrecompiledRE()
private void testSplitAndGrep()
private void testSubst()
public void assertEquals(java.lang.String message, java.lang.String expected, java.lang.String actual)
public void assertEquals(java.lang.String message, int expected, int actual)
private boolean getExpectedResult(java.lang.String yesno)
yesno
- string representation of expected resultprivate java.lang.String findNextTest(java.io.BufferedReader br) throws java.io.IOException
br
- BufferedReader
for a script filejava.io.IOException
- if some io problems occuredprivate RETestCase getNextTestCase(java.io.BufferedReader br) throws java.io.IOException
br
- BufferedReader
for script file.java.io.IOException
- if some io problems occuredCopyright © 2001-2007 Apache Software Foundation. All Rights Reserved.