

Task

Using a well-known testing-specific library/module/suite for your language, write some tests for your language's entry in Palindrome.

If your language does not have a testing specific library well known to the language's community then state this or omit the language.



/* 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
 