Exemplo n.º 1
0
 public void diff_prettyHtmlTest()
 {
     var dmp = new diff_match_patchTest();
     // Pretty print.
     var diffs = new List<Diff>{
         new Diff(Operation.Equal, "a\n"),
         new Diff(Operation.Delete, "<B>b</B>"),
         new Diff(Operation.Insert, "c&d")
     };
     Assert.AreEqual("<span>a&para;<br></span><del style=\"background:#ffe6e6;\">&lt;B&gt;b&lt;/B&gt;</del><ins style=\"background:#e6ffe6;\">c&amp;d</ins>",
                     dmp.diff_prettyHtml(diffs));
 }
Exemplo n.º 2
0
        public void diff_prettyHtmlTest()
        {
            diff_match_patchTest dmp = new diff_match_patchTest();
            // Pretty print.
            List<Diff> diffs = new List<Diff>{
                new Diff(Operation.EQUAL, "a\n"),
                new Diff(Operation.DELETE, "<B>b</B>"),
                new Diff(Operation.INSERT, "c&d")};

            Assert.AreEqual("<SPAN TITLE=\"i=0\">a&para;<BR></SPAN><DEL STYLE=\"background:#FFE6E6;\" TITLE=\"i=2\">&lt;B&gt;b&lt;/B&gt;</DEL><INS STYLE=\"background:#E6FFE6;\" TITLE=\"i=2\">c&amp;d</INS>",
                dmp.diff_prettyHtml(diffs));
        }