#!/bin/bash # Test: XML parser tests #PROG="valgrind --leak-check=full --show-leak-kinds=all ../util/clixon_util_xml" PROG=../util/clixon_util_xml # include err() and new() functions and creates $dir . ./lib.sh new "xml parse" expecteof "$PROG" 0 "" "^$" XML=$(cat <An example of escaped CENDs y" so I guess that means that z > x ]]> ]]> ]]> EOF ) new "xml CDATA" expecteof "$PROG" 0 "$XML" "^An example of escaped CENDs y\" so I guess that means that z > x ]]> ]]>]]>$" XML=$(cat <Less than: < , greater than: > ampersand: & EOF ) new "xml encode <>&" expecteof "$PROG" 0 "$XML" "^$XML$" XML=$(cat <To allow attribute values to contain both single and double quotes, the apostrophe or single-quote character ' may be represented as ' and the double-quote character as " EOF ) new "xml optional encode single and double quote" expecteof "$PROG" 0 "$XML" "^To allow attribute values to contain both single and double quotes, the apostrophe or single-quote character ' may be represented as ' and the double-quote character as \"$" rm -rf $dir