Debian Codegraph @

tests/overstrip/run-test

raw
1 #!/bin/sh
2
3 # This is a filterdiff(1) testcase.
4 # Test: --strip behaves when stripping more pathname components than there are.
5
6
7 . ${top_srcdir-.}/tests/common.sh
8
9 cat << EOF > diff
10 --- file
11 +++ dir/file
12 @@ -1 +1 @@
13 -a
14 +A
15 EOF
16 ${FILTERDIFF} --strip=2 diff 2>errors >diff-stripped || exit 1
17 [ -s errors ] && exit 1
18
19 cat << EOF | cmp - diff-stripped || exit 1
20 --- file
21 +++ file
22 @@ -1 +1 @@
23 -a
24 +A
25 EOF