Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
16
Task/Test-a-function/Racket/test-a-function.rkt
Normal file
16
Task/Test-a-function/Racket/test-a-function.rkt
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
#lang racket
|
||||
(module+ test (require rackunit))
|
||||
|
||||
;; from the Palindrome entry
|
||||
(define (palindromb str)
|
||||
(let* ([lst (string->list (string-downcase str))]
|
||||
[slst (remove* '(#\space) lst)])
|
||||
(string=? (list->string (reverse slst)) (list->string slst))))
|
||||
|
||||
;; this test module is not loaded unless it is
|
||||
;; specifically requested for testing, allowing internal
|
||||
;; unit test specification
|
||||
(module+ test
|
||||
(check-true (palindromb "racecar"))
|
||||
(check-true (palindromb "avoova"))
|
||||
(check-false (palindromb "potato")))
|
||||
Loading…
Add table
Add a link
Reference in a new issue