3 # Most checks should be done by the client. For example, recursion loop
4 # checking is not done after the element has been moved.
7 source import-common.sh
16 passphrase_file=`pwd`/list.key
19 mv -f data
/list data
/move
23 echo "Test 1. Move src to src (fail)."
25 echo -ne 'MOVE !a !a' | pwmc
$PWMC_ARGS move
26 if [ ${PIPESTATUS[1]} == 0 ]; then
27 echo "The previous command should have failed. Stopping."
34 echo "Test 2. Move non-existant (fail)."
36 echo -ne 'MOVE non-existant !a' | pwmc
$PWMC_ARGS move
37 if [ ${PIPESTATUS[1]} == 0 ]; then
38 echo "The previous command should have failed. Stopping."
45 echo "Test 3. Move child with target to root."
46 echo -ne 'MOVE !a\t!b\tc ' | pwmc
$PWMC_ARGS move
49 echo "Test 4. Move child to sibling child with target."
50 echo -ne 'MOVE !a\tc !a\tb\tc\td\te' | pwmc
$PWMC_ARGS -S move
51 echo -ne 'LIST --all --with-target' | pwmc
$PWMC_ARGS move
> result
52 cmp move.result4 result
56 echo "Test 5. Move child with target to parent sibling."
57 echo -ne 'MOVE !a\tb\tc\td\te\tc !a' | pwmc
$PWMC_ARGS -S move
58 echo -ne 'LIST --all --with-target' | pwmc
$PWMC_ARGS move
> result
59 cmp move.result5 result
63 echo "Test 6. Overwrite existing tree."
64 echo -ne 'MOVE !a\tb\tc\t!d ' | pwmc
$PWMC_ARGS -S move
65 echo -ne 'LIST --all --with-target' | pwmc
$PWMC_ARGS move
> result
66 cmp move.result6 result
70 echo "Test 7. Show child elements whose target contains an error."
71 echo -ne 'MOVE !d c\te' | pwmc
$PWMC_ARGS -S move
72 echo -ne 'LIST --all --with-target' | pwmc
$PWMC_ARGS move
> result
73 cmp move.result7 result