(t *testing.T)
| 6 | ) |
| 7 | |
| 8 | func TestCreateAndApplyPatch(t *testing.T) { |
| 9 | old := "Hello world\nThis is a test\nThird line" |
| 10 | new := "Hello world\nThis is modified\nThird line\nFourth line" |
| 11 | |
| 12 | patch := CreatePatch(old, new) |
| 13 | if patch == "" { |
| 14 | t.Fatal("expected non-empty patch") |
| 15 | } |
| 16 | |
| 17 | result, err := ApplyPatch(old, patch) |
| 18 | if err != nil { |
| 19 | t.Fatalf("ApplyPatch error: %v", err) |
| 20 | } |
| 21 | if result != new { |
| 22 | t.Errorf("expected %q, got %q", new, result) |
| 23 | } |
| 24 | } |
| 25 | |
| 26 | func TestReversePatch(t *testing.T) { |
| 27 | old := "# Document\n\nOriginal content here." |
nothing calls this directly
no test coverage detected