summaryrefslogtreecommitdiffstats
path: root/src/internal/diff/testdata
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-16 19:23:18 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-16 19:23:18 +0000
commit43a123c1ae6613b3efeed291fa552ecd909d3acf (patch)
treefd92518b7024bc74031f78a1cf9e454b65e73665 /src/internal/diff/testdata
parentInitial commit. (diff)
downloadgolang-1.20-43a123c1ae6613b3efeed291fa552ecd909d3acf.tar.xz
golang-1.20-43a123c1ae6613b3efeed291fa552ecd909d3acf.zip
Adding upstream version 1.20.14.upstream/1.20.14upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/internal/diff/testdata')
-rw-r--r--src/internal/diff/testdata/allnew.txt13
-rw-r--r--src/internal/diff/testdata/allold.txt13
-rw-r--r--src/internal/diff/testdata/basic.txt35
-rw-r--r--src/internal/diff/testdata/dups.txt40
-rw-r--r--src/internal/diff/testdata/end.txt38
-rw-r--r--src/internal/diff/testdata/eof.txt9
-rw-r--r--src/internal/diff/testdata/eof1.txt18
-rw-r--r--src/internal/diff/testdata/eof2.txt18
-rw-r--r--src/internal/diff/testdata/long.txt62
-rw-r--r--src/internal/diff/testdata/same.txt5
-rw-r--r--src/internal/diff/testdata/start.txt34
-rw-r--r--src/internal/diff/testdata/triv.txt40
12 files changed, 325 insertions, 0 deletions
diff --git a/src/internal/diff/testdata/allnew.txt b/src/internal/diff/testdata/allnew.txt
new file mode 100644
index 0000000..8875649
--- /dev/null
+++ b/src/internal/diff/testdata/allnew.txt
@@ -0,0 +1,13 @@
+-- old --
+-- new --
+a
+b
+c
+-- diff --
+diff old new
+--- old
++++ new
+@@ -0,0 +1,3 @@
++a
++b
++c
diff --git a/src/internal/diff/testdata/allold.txt b/src/internal/diff/testdata/allold.txt
new file mode 100644
index 0000000..bcc9ac0
--- /dev/null
+++ b/src/internal/diff/testdata/allold.txt
@@ -0,0 +1,13 @@
+-- old --
+a
+b
+c
+-- new --
+-- diff --
+diff old new
+--- old
++++ new
+@@ -1,3 +0,0 @@
+-a
+-b
+-c
diff --git a/src/internal/diff/testdata/basic.txt b/src/internal/diff/testdata/basic.txt
new file mode 100644
index 0000000..d2565b5
--- /dev/null
+++ b/src/internal/diff/testdata/basic.txt
@@ -0,0 +1,35 @@
+Example from Hunt and McIlroy, “An Algorithm for Differential File Comparison.”
+https://www.cs.dartmouth.edu/~doug/diff.pdf
+
+-- old --
+a
+b
+c
+d
+e
+f
+g
+-- new --
+w
+a
+b
+x
+y
+z
+e
+-- diff --
+diff old new
+--- old
++++ new
+@@ -1,7 +1,7 @@
++w
+ a
+ b
+-c
+-d
++x
++y
++z
+ e
+-f
+-g
diff --git a/src/internal/diff/testdata/dups.txt b/src/internal/diff/testdata/dups.txt
new file mode 100644
index 0000000..d10524d
--- /dev/null
+++ b/src/internal/diff/testdata/dups.txt
@@ -0,0 +1,40 @@
+-- old --
+a
+
+b
+
+c
+
+d
+
+e
+
+f
+-- new --
+a
+
+B
+
+C
+
+d
+
+e
+
+f
+-- diff --
+diff old new
+--- old
++++ new
+@@ -1,8 +1,8 @@
+ a
+ $
+-b
+-
+-c
++B
++
++C
+ $
+ d
+ $
diff --git a/src/internal/diff/testdata/end.txt b/src/internal/diff/testdata/end.txt
new file mode 100644
index 0000000..158637c
--- /dev/null
+++ b/src/internal/diff/testdata/end.txt
@@ -0,0 +1,38 @@
+-- old --
+1
+2
+3
+4
+5
+6
+7
+eight
+nine
+ten
+eleven
+-- new --
+1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+-- diff --
+diff old new
+--- old
++++ new
+@@ -5,7 +5,6 @@
+ 5
+ 6
+ 7
+-eight
+-nine
+-ten
+-eleven
++8
++9
++10
diff --git a/src/internal/diff/testdata/eof.txt b/src/internal/diff/testdata/eof.txt
new file mode 100644
index 0000000..5dc145c
--- /dev/null
+++ b/src/internal/diff/testdata/eof.txt
@@ -0,0 +1,9 @@
+-- old --
+a
+b
+c^D
+-- new --
+a
+b
+c^D
+-- diff --
diff --git a/src/internal/diff/testdata/eof1.txt b/src/internal/diff/testdata/eof1.txt
new file mode 100644
index 0000000..1ebf621
--- /dev/null
+++ b/src/internal/diff/testdata/eof1.txt
@@ -0,0 +1,18 @@
+-- old --
+a
+b
+c
+-- new --
+a
+b
+c^D
+-- diff --
+diff old new
+--- old
++++ new
+@@ -1,3 +1,3 @@
+ a
+ b
+-c
++c
+\ No newline at end of file
diff --git a/src/internal/diff/testdata/eof2.txt b/src/internal/diff/testdata/eof2.txt
new file mode 100644
index 0000000..047705e
--- /dev/null
+++ b/src/internal/diff/testdata/eof2.txt
@@ -0,0 +1,18 @@
+-- old --
+a
+b
+c^D
+-- new --
+a
+b
+c
+-- diff --
+diff old new
+--- old
++++ new
+@@ -1,3 +1,3 @@
+ a
+ b
+-c
+\ No newline at end of file
++c
diff --git a/src/internal/diff/testdata/long.txt b/src/internal/diff/testdata/long.txt
new file mode 100644
index 0000000..3fc99f7
--- /dev/null
+++ b/src/internal/diff/testdata/long.txt
@@ -0,0 +1,62 @@
+-- old --
+1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+14½
+15
+16
+17
+18
+19
+20
+-- new --
+1
+2
+3
+4
+5
+6
+8
+9
+10
+11
+12
+13
+14
+17
+18
+19
+20
+-- diff --
+diff old new
+--- old
++++ new
+@@ -4,7 +4,6 @@
+ 4
+ 5
+ 6
+-7
+ 8
+ 9
+ 10
+@@ -12,9 +11,6 @@
+ 12
+ 13
+ 14
+-14½
+-15
+-16
+ 17
+ 18
+ 19
diff --git a/src/internal/diff/testdata/same.txt b/src/internal/diff/testdata/same.txt
new file mode 100644
index 0000000..86b1100
--- /dev/null
+++ b/src/internal/diff/testdata/same.txt
@@ -0,0 +1,5 @@
+-- old --
+hello world
+-- new --
+hello world
+-- diff --
diff --git a/src/internal/diff/testdata/start.txt b/src/internal/diff/testdata/start.txt
new file mode 100644
index 0000000..217b2fd
--- /dev/null
+++ b/src/internal/diff/testdata/start.txt
@@ -0,0 +1,34 @@
+-- old --
+e
+pi
+4
+5
+6
+7
+8
+9
+10
+-- new --
+1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+-- diff --
+diff old new
+--- old
++++ new
+@@ -1,5 +1,6 @@
+-e
+-pi
++1
++2
++3
+ 4
+ 5
+ 6
diff --git a/src/internal/diff/testdata/triv.txt b/src/internal/diff/testdata/triv.txt
new file mode 100644
index 0000000..ab5759f
--- /dev/null
+++ b/src/internal/diff/testdata/triv.txt
@@ -0,0 +1,40 @@
+Another example from Hunt and McIlroy,
+“An Algorithm for Differential File Comparison.”
+https://www.cs.dartmouth.edu/~doug/diff.pdf
+
+Anchored diff gives up on finding anything,
+since there are no unique lines.
+
+-- old --
+a
+b
+c
+a
+b
+b
+a
+-- new --
+c
+a
+b
+a
+b
+c
+-- diff --
+diff old new
+--- old
++++ new
+@@ -1,7 +1,6 @@
+-a
+-b
+-c
+-a
+-b
+-b
+-a
++c
++a
++b
++a
++b
++c