3 source import-common.sh
12 passphrase_file=`pwd`/list.key
16 mv -f data
/list data
/copy
20 echo "Test 1. Copy element to self."
21 echo -ne 'COPY !a !a' | pwmc
$PWMC_ARGS -S copy
22 echo -ne 'LIST --all --with-target' | pwmc
$PWMC_ARGS copy
> result
23 cmp copy.result1 result
27 echo "Test 2. Copy element to new root."
28 echo -ne 'COPY !a !new' | pwmc
$PWMC_ARGS -S copy
29 echo -ne 'LIST --all --with-target' | pwmc
$PWMC_ARGS copy
> result
30 cmp copy.result2 result
34 echo "Test 3. Copy element to new child."
35 echo -ne 'COPY new !a\tnew' | pwmc
$PWMC_ARGS -S copy
36 echo -ne 'LIST --all --with-target' | pwmc
$PWMC_ARGS copy
> result
37 cmp copy.result3 result
41 echo "Test 4. Copy element to root and overwrite."
42 echo -ne 'COPY new !a' | pwmc
$PWMC_ARGS -S copy
43 echo -ne 'LIST --all --with-target' | pwmc
$PWMC_ARGS copy
> result
44 cmp copy.result4 result
48 echo "Test 5. Copy element to child and overwrite."
49 echo -ne 'COPY new !a\tb' | pwmc
$PWMC_ARGS -S copy
50 echo -ne 'LIST --all --with-target' | pwmc
$PWMC_ARGS copy
> result
51 cmp copy.result5 result
55 echo "Test 6. Copy element to target."
56 echo -ne 'COPY new b' | pwmc
$PWMC_ARGS -S copy
57 echo -ne 'LIST --all --with-target' | pwmc
$PWMC_ARGS copy
> result
58 cmp copy.result6 result