aboutsummaryrefslogtreecommitdiff
path: root/tests/diff.test
blob: ce51f1e89b8c924edafc4051f0d9e7474d85d9bc (plain)
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
#!/bin/bash

#testing "name" "command" "result" "infile" "stdin"

seq 10 > left
seq 11 > right

expected='--- lll
+++ rrr
@@ -8,3 +8,4 @@
 8
 9
 10
+11
'
# Hm this only gives unified diffs?
testing "simple" "diff -L lll -L rrr left right" "$expected" "" ""


expected='--- tree1/file
+++ tree2/file
@@ -1 +1 @@
-foo
+food
'
mkdir -p tree1 tree2
echo foo > tree1/file
echo food > tree2/file

testing "simple" "diff -r -L tree1/file -L tree2/file tree1 tree2 |tee out" "$expected" "" ""