Skip to main content
100%

Problem 6 of 99 Problems (adapted from https://johncrane.gitbooks.io/ninety-nine-elm-problems/content/p/p06.html)

✓ Published0🌍 Public
CCliffordAnderson
Last edited Mar 17, 2018
Created on Mar 16, 2018

This example demonstrates a unit test suite for a palindrome-checking function written in XQuery, using the BaseX XQUnit testing framework. It shows how `fn:deep-equal` and `fn:reverse` from the XQuery 3.1 standard library verify that sequences of items (including numbers and strings) read identically forward and backward. The test cases, defined with `%unit:test` annotations and `unit:assert-equals`, cover positive and negative cases, single-item and empty sequences, and string-element palindromes. The code is organized as a module with a namespace and imported test module, reflecting a modular approach to test-driven development.

AI-generated description

Similar vizzes