(t *testing.T)
| 100 | } |
| 101 | |
| 102 | func TestPatchToText(t *testing.T) { |
| 103 | type TestCase struct { |
| 104 | Patch string |
| 105 | } |
| 106 | |
| 107 | dmp := New() |
| 108 | |
| 109 | for i, tc := range []TestCase{ |
| 110 | {"@@ -21,18 +22,17 @@\n jump\n-s\n+ed\n over \n-the\n+a\n laz\n"}, |
| 111 | {"@@ -1,9 +1,9 @@\n-f\n+F\n oo+fooba\n@@ -7,9 +7,9 @@\n obar\n-,\n+.\n tes\n"}, |
| 112 | } { |
| 113 | patches, err := dmp.PatchFromText(tc.Patch) |
| 114 | assert.Nil(t, err) |
| 115 | |
| 116 | actual := dmp.PatchToText(patches) |
| 117 | assert.Equal(t, tc.Patch, actual, fmt.Sprintf("Test case #%d, %#v", i, tc)) |
| 118 | } |
| 119 | } |
| 120 | |
| 121 | func TestPatchAddContext(t *testing.T) { |
| 122 | type TestCase struct { |
nothing calls this directly
no test coverage detected
searching dependent graphs…