RosettaCodeData/Task/Test-a-function/Retro/test-a-function.retro

11 lines
286 B
Plaintext

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