Test a function: Difference between revisions
→{{header|Kotlin}}: Improved example
(Added Kotlin) |
(→{{header|Kotlin}}: Improved example) |
||
Line 801:
fun main(args: Array<String>) {
for (testCase in testCases) {
try {
assert(isPalindrome(testCase)) { "$testCase is not a palindrome" }
}
catch (ae: AssertionError) {
println(ae.message)
}
}
}</lang>
{{out}}
<pre>
alice is not a palindrome
david is not a palindrome
</pre>
|