3 source import-common.sh
12 passphrase_file=`pwd`/passphrase.key
16 mv -f data
/list data
/xpath
20 test_header
"Test 1. XPATH no matching elements (fail)."
22 echo -ne 'XPATH /element' | pwmc
$PWMC_ARGS xpath
23 if [ ${PIPESTATUS[1]} == 0 ]; then
24 echo "The previous command should have failed. Stopping."
31 test_header
"Test 2. XPATH invalid expression syntax (fail)."
33 echo -ne 'XPATH /element[]' | pwmc
$PWMC_ARGS xpath
34 if [ ${PIPESTATUS[1]} == 0 ]; then
35 echo "The previous command should have failed. Stopping."
42 test_header
"Test 3. Retrieve expression."
43 echo -ne 'XPATH //element[@_name="a"]' | pwmc
$PWMC_ARGS xpath
> result
44 cmp xpath.result3 result
48 test_header
"Test 4. Set expression value."
49 echo -ne 'XPATH /pwmd/element[@_name="a"]\tnew value' | pwmc
$PWMC_ARGS -S xpath
50 echo -ne 'LIST --recurse' | pwmc
$PWMC_ARGS xpath
> result
51 cmp xpath.result4 result