

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.



proc reversed(s: string): string =
  result = newString(s.len)
  for i, c in s:
    result[s.high - i] = c
 
proc isPalindrome(s: string): bool =
  s == reversed(s)
 
when isMainModule:
  assert(isPalindrome(""))
  assert(isPalindrome("a"))
  assert(isPalindrome("aa"))
  assert(not isPalindrome("baa"))
  assert(isPalindrome("baab"))
  assert(isPalindrome("ba_ab"))
  assert(not isPalindrome("ba_ ab"))
  assert(isPalindrome("ba _ ab"))
  assert(not isPalindrome("abab"))