3 source import-common.sh
12 passphrase_file=`pwd`/list.key
16 mv -f data
/list data
/xpath
20 echo "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 echo "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 echo "Test 3. Retrieve expression."
43 echo -ne 'XPATH //element[@_name="a"]' | pwmc
$PWMC_ARGS xpath
> result
44 cmp xpath.result3 result
48 echo "Test 4. Set expression value."
49 echo -ne 'XPATH /pwmd/element[@_name="a"]\tnew value' | pwmc
$PWMC_ARGS -S xpath
50 echo -ne 'LIST --all --with-target' | pwmc
$PWMC_ARGS xpath
> result
51 cmp xpath.result4 result