(phixonline)-->
with javascript_semantics
requires("0.8.2")
function is_palindrome(sequence s)
return s==reverse(s)
end function
--set_test_verbosity(TEST_QUIET) -- default, no output when third call removed
--set_test_verbosity(TEST_SUMMARY) -- first and last line only [w or w/o ""]
--set_test_verbosity(TEST_SHOW_FAILED) -- first and last two lines only
set_test_verbosity(TEST_SHOW_ALL) -- as shown in last two cases below
--set_test_abort(TEST_ABORT) -- abort(1) on failure, after showing the summary
--set_test_abort(TEST_QUIET) -- quietly carry on, the default
--set_test_abort(TEST_CRASH) -- abort immmediately on failure (w/o summary)
--set_test_pause(TEST_PAUSE_FAIL) -- pause on failure, the default
--set_test_pause(TEST_QUIET) -- disable pause on failure
--set_test_pause(TEST_PAUSE) -- always pause
set_test_module("palindromes") -- optional, w/o first line is omitted
test_true(is_palindrome("abba"),"abba")
test_true(is_palindrome("abba")) -- no desc makes success hidden...
-- ...and failure somewhat laconic
test_false(is_palindrome("abc"),"not abc")
test_true(is_palindrome("failure"),"failure")
test_summary()