Debian Codegraph @

tests/combine6/run-test

raw
1 #!/bin/sh
2
3 # Test combinediff with file deletion (regular file to /dev/null)
4 # This tests /dev/null handling in the reverse direction
5
6 . ${top_srcdir-.}/tests/common.sh
7
8 # Create first patch that creates a file
9 cat << EOF > patch1
10 --- /dev/null
11 +++ b/tempfile.txt
12 @@ -0,0 +1,3 @@
13 +temporary
14 +content
15 +here
16 EOF
17
18 # Create second patch that deletes the same file
19 cat << EOF > patch2
20 --- a/tempfile.txt
21 +++ /dev/null
22 @@ -1,3 +0,0 @@
23 -temporary
24 -content
25 -here
26 EOF
27
28 # Run combinediff
29 ${COMBINEDIFF} patch1 patch2 2>errors >actual || exit 1
30 [ -s errors ] && exit 1
31
32 # Expected combined output should be empty (create then delete = no change)
33 diff -u /dev/null actual || exit 1
34
35 exit 0