本文整理汇总了C#中nicTest.diff_match_patchTest.patch_addContext方法的典型用法代码示例。如果您正苦于以下问题:C# diff_match_patchTest.patch_addContext方法的具体用法?C# diff_match_patchTest.patch_addContext怎么用?C# diff_match_patchTest.patch_addContext使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类nicTest.diff_match_patchTest
的用法示例。
在下文中一共展示了diff_match_patchTest.patch_addContext方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: patch_addContextTest
public void patch_addContextTest()
{
var dmp = new diff_match_patchTest{Patch_Margin = 4};
Patch p = dmp.patch_fromText("@@ -21,4 +21,10 @@\n-jump\n+somersault\n")[0];
dmp.patch_addContext(p, "The quick brown fox jumps over the lazy dog.");
Assert.AreEqual("@@ -17,12 +17,18 @@\n fox \n-jump\n+somersault\n s ov\n", p.ToString(), "patch_addContext: Simple case.");
p = dmp.patch_fromText("@@ -21,4 +21,10 @@\n-jump\n+somersault\n")[0];
dmp.patch_addContext(p, "The quick brown fox jumps.");
Assert.AreEqual("@@ -17,10 +17,16 @@\n fox \n-jump\n+somersault\n s.\n", p.ToString(), "patch_addContext: Not enough trailing context.");
p = dmp.patch_fromText("@@ -3 +3,2 @@\n-e\n+at\n")[0];
dmp.patch_addContext(p, "The quick brown fox jumps.");
Assert.AreEqual("@@ -1,7 +1,8 @@\n Th\n-e\n+at\n qui\n", p.ToString(), "patch_addContext: Not enough leading context.");
p = dmp.patch_fromText("@@ -3 +3,2 @@\n-e\n+at\n")[0];
dmp.patch_addContext(p, "The quick brown fox jumps. The quick brown fox crashes.");
Assert.AreEqual("@@ -1,27 +1,28 @@\n Th\n-e\n+at\n quick brown fox jumps. \n", p.ToString(), "patch_addContext: Ambiguity.");
}