aboutsummaryrefslogtreecommitdiffstats
path: root/tests/t0100-redo.t
blob: b0bad3d58f70caae3ba4518a6a7f378e43711446 (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
35
36
37
38
#!/bin/sh -e
# Copyright (c) 2015-2016 Tharre
#
# This software may be modified and distributed under the terms
# of the MIT license.  See the LICENSE file for details.

test_description='Redo tests'

. ./sharness.sh

cat > "a.do" <<'EOF'
#!/bin/sh -e
redo-ifchange b
echo "a" | cat - b > $3
EOF

cat > "b.do" <<'EOF'
#!/bin/sh -e
redo-ifchange c
[ -e "b" ] && exit 1
echo "b" | cat - c > $3
EOF

cat > "c.do" <<'EOF'
#!/bin/sh -e
redo-ifchange s
echo "c" > $3
EOF

test_expect_success "redo shortcuts" "
    echo "s1" > s &&
    redo a &&
    sleep 1 && # TODO: remove this as soon as REDO_MAGIC is fixed
    echo "s2" > s &&
    redo a
"

test_done