blob: ca6d28f2a91545bab047b55beb045d1afc72f201 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
|
#!/bin/sh -e
# Copyright (c) 2015 Tharre
#
# This software may be modified and distributed under the terms
# of the MIT license. See the LICENSE file for details.
test_description='Check arguments supplied to the do-script'
. ./sharness.sh
mkdir d &&
cat > "d/check_args.ext1.ext2.do" <<'EOF'
#!/bin/sh -e
[ "$1" = "check_args.ext1.ext2" ]
[ "$2" = "check_args.ext1" ]
[ "$3" != "check_args.ext1.ext2" ]
EOF
cat > "absolute_paths.do" <<'EOF'
#!/bin/sh -e
cd /tmp
echo "test" > $3
EOF
test_expect_success "check arguments" "
redo d/check_args.ext1.ext2
"
test_expect_success "\$3 should be absolute" "
redo absolute_paths &&
[ -e absolute_paths ]
"
test_done
|