RosettaCodeData/Task/Test-a-function/Retro/test-a-function.retro
2023-07-01 13:44:08 -04:00

10 lines
286 B
Text

needs assertion'
needs hash'
: palindrome? ( $-f ) dup ^hash'hash [ ^strings'reverse ^hash'hash ] dip = ;
with assertion'
: t0 ( - ) "hello" palindrome? 0 assert= ; assertion
: t1 ( - ) "ingirumimusnocteetconsumimurigni" palindrome? -1 assert= ; assertion
: test ( - ) t0 t1 ;
test