Test a function: Difference between revisions
Content added Content deleted
Thundergnat (talk | contribs) (Rename Perl 6 -> Raku, alphabetize, minor clean-up) |
|||
Line 1: | Line 1: | ||
{{task|Testing}}{{omit from|BBC BASIC}} |
{{task|Testing}}{{omit from|BBC BASIC}} |
||
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. |
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. |
||
=={{header|ACL2}}== |
=={{header|ACL2}}== |
||
Line 196: | Line 196: | ||
assert(IsPalindrome("alice")); |
assert(IsPalindrome("alice")); |
||
} |
} |
||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
</lang> |
</lang> |
||
Line 286: | Line 275: | ||
} |
} |
||
}</lang> |
}</lang> |
||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
=={{header|Crystal}}== |
=={{header|Crystal}}== |
||
Line 434: | Line 434: | ||
</lang> |
</lang> |
||
=={{header|F_Sharp|F#}}== |
=={{header|F_Sharp|F#}}== |
||
Line 454: | Line 453: | ||
member x.Test02() = |
member x.Test02() = |
||
Assert.IsFalse(palindrome "hello")</lang> |
Assert.IsFalse(palindrome "hello")</lang> |
||
=={{header|Factor}}== |
=={{header|Factor}}== |
||
Line 689: | Line 687: | ||
} |
} |
||
}</lang> |
}</lang> |
||
=={{header|JavaScript}}== |
=={{header|JavaScript}}== |
||
Line 1,246: | Line 1,243: | ||
let _ = |
let _ = |
||
run_test_tt_main suite</lang> |
run_test_tt_main suite</lang> |
||
=={{header|Oforth}}== |
=={{header|Oforth}}== |
||
Line 1,359: | Line 1,354: | ||
Files=1, Tests=24, 0 wallclock secs ( 0.02 usr 0.01 sys + 0.02 cusr 0.00 csys = 0.05 CPU) |
Files=1, Tests=24, 0 wallclock secs ( 0.02 usr 0.01 sys + 0.02 cusr 0.00 csys = 0.05 CPU) |
||
Result: FAIL</pre> |
Result: FAIL</pre> |
||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
=={{header|PicoLisp}}== |
=={{header|PicoLisp}}== |
||
Line 1,412: | Line 1,377: | ||
:- end_tests(palindrome).</lang> |
:- end_tests(palindrome).</lang> |
||
=={{header|PureBasic}}== |
=={{header|PureBasic}}== |
||
Line 1,443: | Line 1,407: | ||
Assert(IsPalindrome(text1$), "Catching this would be a fail") |
Assert(IsPalindrome(text1$), "Catching this would be a fail") |
||
Assert(IsPalindrome(text2$), "Catching this is correct")</lang> |
Assert(IsPalindrome(text2$), "Catching this is correct")</lang> |
||
=={{header|Python}}== |
=={{header|Python}}== |
||
Line 1,597: | Line 1,560: | ||
(check-false (palindromb "potato"))) |
(check-false (palindromb "potato"))) |
||
</lang> |
</lang> |
||
⚫ | |||
(formerly Perl 6) |
|||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
=={{header|Retro}}== |
=={{header|Retro}}== |