mirror of
https://github.com/bluekeyes/go-gitdiff
synced 2026-06-08 13:18:30 +00:00
Add error tests for TextFragment#ApplyStrict
These cover the errors that can happen with a single fragment and no additional manipulation by the caller of ApplyStrict.
This commit is contained in:
+13
@@ -0,0 +1,13 @@
|
||||
line 1
|
||||
line 2
|
||||
line 3
|
||||
line 4
|
||||
line 5
|
||||
line 6
|
||||
line 7
|
||||
line 8
|
||||
line 9
|
||||
line 10
|
||||
line 11
|
||||
line 12
|
||||
line 13
|
||||
@@ -0,0 +1,12 @@
|
||||
diff --git a/gitdiff/testdata/apply/text_fragment_error.src b/gitdiff/testdata/apply/text_fragment_error.src
|
||||
--- a/gitdiff/testdata/apply/text_fragment_error.src
|
||||
+++ b/gitdiff/testdata/apply/text_fragment_error.src
|
||||
@@ -4,7 +4,7 @@ line 3
|
||||
line 4
|
||||
line 5
|
||||
line conflict
|
||||
-line 7
|
||||
+new line a
|
||||
line 8
|
||||
line 9
|
||||
line 10
|
||||
@@ -0,0 +1,12 @@
|
||||
diff --git a/gitdiff/testdata/apply/text_fragment_error.src b/gitdiff/testdata/apply/text_fragment_error.src
|
||||
--- a/gitdiff/testdata/apply/text_fragment_error.src
|
||||
+++ b/gitdiff/testdata/apply/text_fragment_error.src
|
||||
@@ -4,7 +4,7 @@ line 3
|
||||
line 4
|
||||
line 5
|
||||
line 6
|
||||
-line conflict
|
||||
+new line a
|
||||
line 8
|
||||
line 9
|
||||
line 10
|
||||
@@ -0,0 +1,7 @@
|
||||
diff --git a/gitdiff/testdata/apply/text_fragment_error.src b/gitdiff/testdata/apply/text_fragment_error.src
|
||||
--- a/gitdiff/testdata/apply/text_fragment_error.src
|
||||
+++ b/gitdiff/testdata/apply/text_fragment_error.src
|
||||
@@ -0,0 +1,3 @@
|
||||
+line 1
|
||||
+line 2
|
||||
+line 3
|
||||
@@ -0,0 +1,12 @@
|
||||
diff --git a/gitdiff/testdata/apply/text_fragment_error.src b/gitdiff/testdata/apply/text_fragment_error.src
|
||||
--- a/gitdiff/testdata/apply/text_fragment_error.src
|
||||
+++ b/gitdiff/testdata/apply/text_fragment_error.src
|
||||
@@ -9,7 +9,7 @@ line 8
|
||||
line 9
|
||||
line 10
|
||||
line 11
|
||||
-line 12
|
||||
+new line a
|
||||
line 13
|
||||
line 14
|
||||
line 15
|
||||
@@ -0,0 +1,12 @@
|
||||
diff --git a/gitdiff/testdata/apply/text_fragment_error.src b/gitdiff/testdata/apply/text_fragment_error.src
|
||||
--- a/gitdiff/testdata/apply/text_fragment_error.src
|
||||
+++ b/gitdiff/testdata/apply/text_fragment_error.src
|
||||
@@ -15,7 +15,7 @@ line 14
|
||||
line 15
|
||||
line 16
|
||||
line 17
|
||||
-line 18
|
||||
+new line a
|
||||
line 19
|
||||
line 20
|
||||
line 21
|
||||
Reference in New Issue
Block a user