|
|
@ -60,6 +60,21 @@ func TestDiffToHTML(t *testing.T) { |
|
|
|
{Type: dmp.DiffInsert, Text: "ge</span><span class=\"p\">.</span><span class=\"nx\">Milestone</span><span class=\"p\">,</span> <span class=\"nx\">from</span><span class=\"p\">,</span> <span class=\"nx\">milestoneID"}, |
|
|
|
{Type: dmp.DiffInsert, Text: "ge</span><span class=\"p\">.</span><span class=\"nx\">Milestone</span><span class=\"p\">,</span> <span class=\"nx\">from</span><span class=\"p\">,</span> <span class=\"nx\">milestoneID"}, |
|
|
|
{Type: dmp.DiffEqual, Text: "</span><span class=\"p\">)</span>"}, |
|
|
|
{Type: dmp.DiffEqual, Text: "</span><span class=\"p\">)</span>"}, |
|
|
|
}, DiffLineDel)) |
|
|
|
}, DiffLineDel)) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assertEqual(t, "<span class=\"nx\">r</span><span class=\"p\">.</span><span class=\"nf\">WrapperRenderer</span><span class=\"p\">(</span><span class=\"nx\">w</span><span class=\"p\">,</span> <span class=\"nx\"><span class=\"removed-code\">language</span></span><span class=\"removed-code\"><span class=\"p\">,</span> <span class=\"kc\">true</span><span class=\"p\">,</span> <span class=\"nx\">attrs</span></span><span class=\"p\">,</span> <span class=\"kc\">false</span><span class=\"p\">)</span>", diffToHTML("", []dmp.Diff{ |
|
|
|
|
|
|
|
{Type: dmp.DiffEqual, Text: "<span class=\"nx\">r</span><span class=\"p\">.</span><span class=\"nf\">WrapperRenderer</span><span class=\"p\">(</span><span class=\"nx\">w</span><span class=\"p\">,</span> <span class=\"nx\">"}, |
|
|
|
|
|
|
|
{Type: dmp.DiffDelete, Text: "language</span><span "}, |
|
|
|
|
|
|
|
{Type: dmp.DiffEqual, Text: "c"}, |
|
|
|
|
|
|
|
{Type: dmp.DiffDelete, Text: "lass=\"p\">,</span> <span class=\"kc\">true</span><span class=\"p\">,</span> <span class=\"nx\">attrs"}, |
|
|
|
|
|
|
|
{Type: dmp.DiffEqual, Text: "</span><span class=\"p\">,</span> <span class=\"kc\">false</span><span class=\"p\">)</span>"}, |
|
|
|
|
|
|
|
}, DiffLineDel)) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assertEqual(t, "<span class=\"added-code\">language</span></span><span class=\"added-code\"><span class=\"p\">,</span> <span class=\"kc\">true</span><span class=\"p\">,</span> <span class=\"nx\">attrs</span></span><span class=\"p\">,</span> <span class=\"kc\">false</span><span class=\"p\">)</span>", diffToHTML("", []dmp.Diff{ |
|
|
|
|
|
|
|
{Type: dmp.DiffInsert, Text: "language</span><span "}, |
|
|
|
|
|
|
|
{Type: dmp.DiffEqual, Text: "c"}, |
|
|
|
|
|
|
|
{Type: dmp.DiffInsert, Text: "lass=\"p\">,</span> <span class=\"kc\">true</span><span class=\"p\">,</span> <span class=\"nx\">attrs"}, |
|
|
|
|
|
|
|
{Type: dmp.DiffEqual, Text: "</span><span class=\"p\">,</span> <span class=\"kc\">false</span><span class=\"p\">)</span>"}, |
|
|
|
|
|
|
|
}, DiffLineAdd)) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
func TestParsePatch(t *testing.T) { |
|
|
|
func TestParsePatch(t *testing.T) { |
|
|
|