44 lines
1.1 KiB
Plaintext
44 lines
1.1 KiB
Plaintext
/* NetRexx */
|
|
|
|
options replace format comments java crossref savelog symbols binary
|
|
|
|
import junit.framework.TestCase
|
|
import RCPalindrome
|
|
|
|
class RCTestAFunction public final extends TestCase
|
|
|
|
method setUp public
|
|
return
|
|
|
|
method tearDown public
|
|
return
|
|
|
|
method testIsPal public signals AssertionError
|
|
|
|
assertTrue(RCPalindrome.isPal(Rexx 'abcba'))
|
|
assertTrue(RCPalindrome.isPal(Rexx 'aa'))
|
|
assertTrue(RCPalindrome.isPal(Rexx 'a'))
|
|
assertTrue(RCPalindrome.isPal(Rexx ''))
|
|
assertFalse(RCPalindrome.isPal(Rexx 'ab'))
|
|
assertFalse(RCPalindrome.isPal(Rexx 'abcdba'))
|
|
|
|
return
|
|
|
|
method except signals RuntimeException
|
|
signal RuntimeException()
|
|
|
|
method main(args = String[]) public constant
|
|
|
|
testResult = org.junit.runner.JUnitCore.runClasses([RCTestAFunction.class])
|
|
|
|
secs = Rexx testResult.getRunTime / 1000.0
|
|
|
|
if testResult.wasSuccessful then say 'Tests successful'
|
|
else say 'Tests failed'
|
|
say ' failure count:' testResult.getFailureCount
|
|
say ' ignore count:' testResult.getIgnoreCount
|
|
say ' run count:' testResult.getRunCount
|
|
say ' run time:' secs.format(null, 3)
|
|
|
|
return
|