aboutsummaryrefslogtreecommitdiff
path: root/usr.bin/diff3/tests
diff options
context:
space:
mode:
authorBaptiste Daroussin <bapt@FreeBSD.org>2017-05-25 17:45:50 +0000
committerBaptiste Daroussin <bapt@FreeBSD.org>2017-05-25 17:45:50 +0000
commite1910ebda4d5972aef64aaf67ea7bcbbba16fa4f (patch)
tree5bd202d3f1ca0c0c22a4982c2edaf5306b9d127f /usr.bin/diff3/tests
parentb08e22797de96cd5222b9bf0ca9f6e993e8c76b4 (diff)
Notes
Diffstat (limited to 'usr.bin/diff3/tests')
-rw-r--r--usr.bin/diff3/tests/1.out14
-rw-r--r--usr.bin/diff3/tests/1.txt6
-rw-r--r--usr.bin/diff3/tests/2.out3
-rw-r--r--usr.bin/diff3/tests/2.txt7
-rw-r--r--usr.bin/diff3/tests/3.out8
-rw-r--r--usr.bin/diff3/tests/3.txt5
-rw-r--r--usr.bin/diff3/tests/4.out8
-rw-r--r--usr.bin/diff3/tests/5.out3
-rw-r--r--usr.bin/diff3/tests/6.out0
-rw-r--r--usr.bin/diff3/tests/7.out14
-rw-r--r--usr.bin/diff3/tests/8.out19
-rw-r--r--usr.bin/diff3/tests/9.out17
-rw-r--r--usr.bin/diff3/tests/Makefile21
-rwxr-xr-xusr.bin/diff3/tests/diff3_test.sh46
14 files changed, 171 insertions, 0 deletions
diff --git a/usr.bin/diff3/tests/1.out b/usr.bin/diff3/tests/1.out
new file mode 100644
index 000000000000..9b872bf3a880
--- /dev/null
+++ b/usr.bin/diff3/tests/1.out
@@ -0,0 +1,14 @@
+====
+1:2,3c
+ which multiple lines
+ and a few typ0s to fix
+2:2,3c
+ which multiple lines
+ and a few typos to fix
+3:2c
+ and a few typ0s to fix
+====2
+1:4a
+3:3a
+2:5c
+ New line
diff --git a/usr.bin/diff3/tests/1.txt b/usr.bin/diff3/tests/1.txt
new file mode 100644
index 000000000000..f0cd8062a6f1
--- /dev/null
+++ b/usr.bin/diff3/tests/1.txt
@@ -0,0 +1,6 @@
+This is a more complete test
+which multiple lines
+and a few typ0s to fix
+also I plan to add few lines
+ and to remove
+other lines
diff --git a/usr.bin/diff3/tests/2.out b/usr.bin/diff3/tests/2.out
new file mode 100644
index 000000000000..420dc4784b80
--- /dev/null
+++ b/usr.bin/diff3/tests/2.out
@@ -0,0 +1,3 @@
+2,3c
+and a few typ0s to fix
+.
diff --git a/usr.bin/diff3/tests/2.txt b/usr.bin/diff3/tests/2.txt
new file mode 100644
index 000000000000..990aa6f345c6
--- /dev/null
+++ b/usr.bin/diff3/tests/2.txt
@@ -0,0 +1,7 @@
+This is a more complete test
+which multiple lines
+and a few typos to fix
+also I plan to add few lines
+New line
+ and to remove
+other lines
diff --git a/usr.bin/diff3/tests/3.out b/usr.bin/diff3/tests/3.out
new file mode 100644
index 000000000000..81509d4ca510
--- /dev/null
+++ b/usr.bin/diff3/tests/3.out
@@ -0,0 +1,8 @@
+3a
+=======
+and a few typ0s to fix
+>>>>>>> 3
+.
+1a
+<<<<<<< 1
+.
diff --git a/usr.bin/diff3/tests/3.txt b/usr.bin/diff3/tests/3.txt
new file mode 100644
index 000000000000..104466e49690
--- /dev/null
+++ b/usr.bin/diff3/tests/3.txt
@@ -0,0 +1,5 @@
+This is a more complete test
+and a few typ0s to fix
+also I plan to add few lines
+ and to remove
+other lines
diff --git a/usr.bin/diff3/tests/4.out b/usr.bin/diff3/tests/4.out
new file mode 100644
index 000000000000..81509d4ca510
--- /dev/null
+++ b/usr.bin/diff3/tests/4.out
@@ -0,0 +1,8 @@
+3a
+=======
+and a few typ0s to fix
+>>>>>>> 3
+.
+1a
+<<<<<<< 1
+.
diff --git a/usr.bin/diff3/tests/5.out b/usr.bin/diff3/tests/5.out
new file mode 100644
index 000000000000..420dc4784b80
--- /dev/null
+++ b/usr.bin/diff3/tests/5.out
@@ -0,0 +1,3 @@
+2,3c
+and a few typ0s to fix
+.
diff --git a/usr.bin/diff3/tests/6.out b/usr.bin/diff3/tests/6.out
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/usr.bin/diff3/tests/6.out
diff --git a/usr.bin/diff3/tests/7.out b/usr.bin/diff3/tests/7.out
new file mode 100644
index 000000000000..9b872bf3a880
--- /dev/null
+++ b/usr.bin/diff3/tests/7.out
@@ -0,0 +1,14 @@
+====
+1:2,3c
+ which multiple lines
+ and a few typ0s to fix
+2:2,3c
+ which multiple lines
+ and a few typos to fix
+3:2c
+ and a few typ0s to fix
+====2
+1:4a
+3:3a
+2:5c
+ New line
diff --git a/usr.bin/diff3/tests/8.out b/usr.bin/diff3/tests/8.out
new file mode 100644
index 000000000000..5d02326ed7d1
--- /dev/null
+++ b/usr.bin/diff3/tests/8.out
@@ -0,0 +1,19 @@
+4a
+>>>>>>> 3
+.
+4a
+<<<<<<< 2
+New line
+=======
+.
+3a
+||||||| 2
+which multiple lines
+and a few typos to fix
+=======
+and a few typ0s to fix
+>>>>>>> 3
+.
+1a
+<<<<<<< 1
+.
diff --git a/usr.bin/diff3/tests/9.out b/usr.bin/diff3/tests/9.out
new file mode 100644
index 000000000000..2071bab4ce07
--- /dev/null
+++ b/usr.bin/diff3/tests/9.out
@@ -0,0 +1,17 @@
+This is a more complete test
+<<<<<<< 1
+which multiple lines
+and a few typ0s to fix
+||||||| 2
+which multiple lines
+and a few typos to fix
+=======
+and a few typ0s to fix
+>>>>>>> 3
+also I plan to add few lines
+<<<<<<< 2
+New line
+=======
+>>>>>>> 3
+ and to remove
+other lines
diff --git a/usr.bin/diff3/tests/Makefile b/usr.bin/diff3/tests/Makefile
new file mode 100644
index 000000000000..dd75be1ca02a
--- /dev/null
+++ b/usr.bin/diff3/tests/Makefile
@@ -0,0 +1,21 @@
+# $FreeBSD$
+
+PACKAGE= tests
+
+ATF_TESTS_SH= diff3_test
+
+${PACKAGE}FILES+= \
+ 1.txt \
+ 2.txt \
+ 3.txt \
+ 1.out \
+ 2.out \
+ 3.out \
+ 4.out \
+ 5.out \
+ 6.out \
+ 7.out \
+ 8.out \
+ 9.out
+
+.include <bsd.test.mk>
diff --git a/usr.bin/diff3/tests/diff3_test.sh b/usr.bin/diff3/tests/diff3_test.sh
new file mode 100755
index 000000000000..9911e7c16432
--- /dev/null
+++ b/usr.bin/diff3/tests/diff3_test.sh
@@ -0,0 +1,46 @@
+# $FreeBSD$
+
+atf_test_case diff3
+atf_test_case diff3_lesssimple
+
+diff3_body()
+{
+ atf_check -o file:$(atf_get_srcdir)/1.out \
+ diff3 $(atf_get_srcdir)/1.txt $(atf_get_srcdir)/2.txt $(atf_get_srcdir)/3.txt
+
+ atf_check -o file:$(atf_get_srcdir)/2.out \
+ diff3 -e $(atf_get_srcdir)/1.txt $(atf_get_srcdir)/2.txt $(atf_get_srcdir)/3.txt
+
+ atf_check -o file:$(atf_get_srcdir)/3.out \
+ diff3 -E -L 1 -L 2 -L 3 $(atf_get_srcdir)/1.txt $(atf_get_srcdir)/2.txt $(atf_get_srcdir)/3.txt
+
+ atf_check -o file:$(atf_get_srcdir)/4.out \
+ diff3 -X -L 1 -L 2 -L 3 $(atf_get_srcdir)/1.txt $(atf_get_srcdir)/2.txt $(atf_get_srcdir)/3.txt
+
+ atf_check -o file:$(atf_get_srcdir)/5.out \
+ diff3 -x $(atf_get_srcdir)/1.txt $(atf_get_srcdir)/2.txt $(atf_get_srcdir)/3.txt
+
+ atf_check -o file:$(atf_get_srcdir)/6.out \
+ diff3 -3 $(atf_get_srcdir)/1.txt $(atf_get_srcdir)/2.txt $(atf_get_srcdir)/3.txt
+
+ atf_check -o file:$(atf_get_srcdir)/7.out \
+ diff3 -i $(atf_get_srcdir)/1.txt $(atf_get_srcdir)/2.txt $(atf_get_srcdir)/3.txt
+
+ atf_check -o file:$(atf_get_srcdir)/8.out \
+ diff3 -A -L 1 -L 2 -L 3 $(atf_get_srcdir)/1.txt $(atf_get_srcdir)/2.txt $(atf_get_srcdir)/3.txt
+
+ atf_check -s exit:1 -o file:$(atf_get_srcdir)/9.out \
+ diff3 -m -L 1 -L 2 -L 3 $(atf_get_srcdir)/1.txt $(atf_get_srcdir)/2.txt $(atf_get_srcdir)/3.txt
+}
+
+diff3_lesssimple_body()
+{
+ atf_check -s exit:1 -o file:$(atf_get_srcdir)/10.out \
+ diff3 -m -L 1 -L 2 -L 3 $(atf_get_srcdir)/4.txt $(atf_get_srcdir)/5.txt $(atf_get_srcdir)/6.txt
+}
+
+atf_init_test_cases()
+{
+ atf_add_test_case diff3
+ atf_add_test_case diff3_lesssimple
+}