(t *testing.T)
| 990 | } |
| 991 | |
| 992 | func TestDiffPrettyHtml(t *testing.T) { |
| 993 | type TestCase struct { |
| 994 | Diffs []Diff |
| 995 | |
| 996 | Expected string |
| 997 | } |
| 998 | |
| 999 | dmp := New() |
| 1000 | |
| 1001 | for i, tc := range []TestCase{ |
| 1002 | { |
| 1003 | Diffs: []Diff{ |
| 1004 | {DiffEqual, "a\n"}, |
| 1005 | {DiffDelete, "<B>b</B>"}, |
| 1006 | {DiffInsert, "c&d"}, |
| 1007 | }, |
| 1008 | |
| 1009 | Expected: "<span>a¶<br></span><del style=\"background:#ffe6e6;\"><B>b</B></del><ins style=\"background:#e6ffe6;\">c&d</ins>", |
| 1010 | }, |
| 1011 | } { |
| 1012 | actual := dmp.DiffPrettyHtml(tc.Diffs) |
| 1013 | assert.Equal(t, tc.Expected, actual, fmt.Sprintf("Test case #%d, %#v", i, tc)) |
| 1014 | } |
| 1015 | } |
| 1016 | |
| 1017 | func TestDiffPrettyText(t *testing.T) { |
| 1018 | type TestCase struct { |
nothing calls this directly
no test coverage detected
searching dependent graphs…