1#! /bin/sh 2 3# exists.sh: Testing for correct behaviour when a file isn't there. 4 5# Import common functions & definitions. 6. ../../common/test-common 7 8 9# If we invert the order of the arguments to prs here, so that the 10# nonexistent file is named first, then those systems which support 11# exceptions will operate correctly, and those which don't, won't. 12 13expands_to () { 14 # $1 -- label 15 # $2 -- format 16 # $3 -- expansion 17docommand $1 "${vg_prs} \"-d$2\" -r1.1 s.1 s.foobar" 1 "$3" "IGNORE" 18} 19 20remove s.1 p.1 1 z.1 s.foobar 21 22# Create file 23echo "Descriptive Text" > DESC 24docommand e1 "${admin} -n -tDESC s.1" 0 "" "" 25remove DESC 26 27docommand e2a "${vg_prs} -d':M:\nX' s.1" 0 "1\nX\n" "" 28docommand e2b "${vg_prs} -d':M:\n' s.1" 0 "1\n" "" 29docommand e2c "${vg_prs} -d':M: 30' s.1" 0 "1 31 32" "" 33 34docommand e3 "${get} -e s.1" 0 "1.1\nnew delta 1.2\n0 lines\n" IGNORE 35echo "hello from %M%" >> 1 36docommand e4 "${delta} -y s.1" 0 "1.2\n1 inserted\n0 deleted\n0 unchanged\n" "" 37 38 39 40expands_to X1 :I: "1.1\n" 41 42 43 44remove s.1 p.1 z.1 1 command.log 45success 46