本文整理匯總了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.");
}