Blob


1 #!/bin/sh
2 #
3 # Copyright (c) 2019 Stefan Sperling <stsp@openbsd.org>
4 #
5 # Permission to use, copy, modify, and distribute this software for any
6 # purpose with or without fee is hereby granted, provided that the above
7 # copyright notice and this permission notice appear in all copies.
8 #
9 # THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10 # WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11 # MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12 # ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13 # WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14 # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15 # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
17 . ./common.sh
19 function test_checkout_basic {
20 local testroot=`test_init checkout_basic`
22 echo "A $testroot/wt/alpha" > $testroot/stdout.expected
23 echo "A $testroot/wt/beta" >> $testroot/stdout.expected
24 echo "A $testroot/wt/epsilon/zeta" >> $testroot/stdout.expected
25 echo "A $testroot/wt/gamma/delta" >> $testroot/stdout.expected
26 echo "Now shut up and hack" >> $testroot/stdout.expected
28 got checkout $testroot/repo $testroot/wt > $testroot/stdout
29 if [ "$?" != "0" ]; then
30 test_done "$testroot" "$?"
31 return 1
32 fi
34 cmp $testroot/stdout.expected $testroot/stdout
35 if [ "$?" != "0" ]; then
36 diff -u $testroot/stdout.expected $testroot/stdout
37 test_done "$testroot" "$?"
38 return 1
39 fi
41 echo "alpha" > $testroot/content.expected
42 echo "beta" >> $testroot/content.expected
43 echo "zeta" >> $testroot/content.expected
44 echo "delta" >> $testroot/content.expected
45 cat $testroot/wt/alpha $testroot/wt/beta $testroot/wt/epsilon/zeta \
46 $testroot/wt/gamma/delta > $testroot/content
48 cmp $testroot/content.expected $testroot/content
49 ret="$?"
50 if [ "$ret" != "0" ]; then
51 diff -u $testroot/content.expected $testroot/content
52 fi
53 test_done "$testroot" "$ret"
54 }
56 run_test test_checkout_basic