61 references to lcs
Microsoft.CodeAnalysis.Workspaces.UnitTests (61)
Differencing\LongestCommonSubsequenceTests.cs (61)
86VerifyMatchingPairs(lcs.GetMatchingPairs(str1, str2), ""); 88VerifyEdits(str1, str2, lcs.GetEdits(str1, str2)); 90Assert.Equal(0.0, lcs.ComputeDistance(str1, str2)); 99VerifyMatchingPairs(lcs.GetMatchingPairs(str1, str2), ""); 101VerifyEdits(str1, str2, lcs.GetEdits(str1, str2)); 103Assert.Equal(1.0, lcs.ComputeDistance(str1, str2)); 112VerifyMatchingPairs(lcs.GetMatchingPairs(str1, str2), "[2,5][1,4][0,3]"); 114VerifyEdits(str1, str2, lcs.GetEdits(str1, str2)); 116Assert.Equal(0.5, lcs.ComputeDistance(str1, str2)); 125VerifyMatchingPairs(lcs.GetMatchingPairs(str1, str2), "[2,2][1,1][0,0]"); 127VerifyEdits(str1, str2, lcs.GetEdits(str1, str2)); 129Assert.Equal(0.5, lcs.ComputeDistance(str1, str2)); 138VerifyMatchingPairs(lcs.GetMatchingPairs(str1, str2), "[2,4][1,1][0,0]"); 140VerifyEdits(str1, str2, lcs.GetEdits(str1, str2)); 142Assert.Equal(0.4, lcs.ComputeDistance(str1, str2)); 151VerifyMatchingPairs(lcs.GetMatchingPairs(str1, str2), ""); 153VerifyEdits(str1, str2, lcs.GetEdits(str1, str2)); 155Assert.Equal(1.0, lcs.ComputeDistance(str1, str2)); 164VerifyMatchingPairs(lcs.GetMatchingPairs(str1, str2), "[2,0]"); 166VerifyEdits(str1, str2, lcs.GetEdits(str1, str2)); 168Assert.Equal(0.75, lcs.ComputeDistance(str1, str2)); 177VerifyMatchingPairs(lcs.GetMatchingPairs(str1, str2), "[1,1][0,0]"); 179VerifyEdits(str1, str2, lcs.GetEdits(str1, str2)); 181Assert.Equal(0.5, lcs.ComputeDistance(str1, str2)); 190VerifyMatchingPairs(lcs.GetMatchingPairs(str1, str2), "[4,2][3,1][0,0]"); 192VerifyEdits(str1, str2, lcs.GetEdits(str1, str2)); 194Assert.Equal(0.4, lcs.ComputeDistance(str1, str2)); 203VerifyMatchingPairs(lcs.GetMatchingPairs(str1, str2), ""); 205VerifyEdits(str1, str2, lcs.GetEdits(str1, str2)); 207Assert.Equal(1.0, lcs.ComputeDistance(str1, str2)); 216VerifyMatchingPairs(lcs.GetMatchingPairs(str1, str2), "[3,2]"); 218VerifyEdits(str1, str2, lcs.GetEdits(str1, str2)); 220Assert.Equal(0.75, lcs.ComputeDistance(str1, str2)); 229VerifyMatchingPairs(lcs.GetMatchingPairs(str1, str2), "[1,1][0,0]"); 231VerifyEdits(str1, str2, lcs.GetEdits(str1, str2)); 233Assert.Equal(0.6, lcs.ComputeDistance(str1, str2)); 242VerifyMatchingPairs(lcs.GetMatchingPairs(str1, str2), "[4,3][3,2][0,0]"); 244VerifyEdits(str1, str2, lcs.GetEdits(str1, str2)); 246Assert.Equal(0.4, lcs.ComputeDistance(str1, str2)); 255VerifyMatchingPairs(lcs.GetMatchingPairs(str1, str2), "[5,4][4,3][1,2][0,0]"); 257VerifyEdits(str1, str2, lcs.GetEdits(str1, str2)); 259Assert.Equal(0.556, lcs.ComputeDistance(str1, str2), precision: 3); 268VerifyMatchingPairs(lcs.GetMatchingPairs(str1, str2), "[7,4][5,3][3,1][0,0]"); 270VerifyEdits(str1, str2, lcs.GetEdits(str1, str2)); 272Assert.Equal(0.6, lcs.ComputeDistance(str1, str2)); 284VerifyMatchingPairs(lcs.GetMatchingPairs(str1, str2), "[6,4][4,3][3,2][1,1]"); 286VerifyEdits(str1, str2, lcs.GetEdits(str1, str2)); 288Assert.Equal(0.429, lcs.ComputeDistance(str1, str2), precision: 3); 300VerifyMatchingPairs(lcs.GetMatchingPairs(str1, str2), "[0,1]"); 302VerifyEdits(str1, str2, lcs.GetEdits(str1, str2)); 304Assert.Equal(0.5, lcs.ComputeDistance(str1, str2)); 324Assert.Equal(0.900, lcs.ComputeDistance(s, sx9), precision: 3); 325Assert.Equal(0.990, lcs.ComputeDistance(s, sx99), precision: 3); 326Assert.Equal(1.000, lcs.ComputeDistance(s, sx1000), precision: 3); 327Assert.Equal(1.000, lcs.ComputeDistance(s, sx100000000), precision: 3); 329Assert.Equal(0.900, lcs.ComputeDistance(sx9, s), precision: 3); 330Assert.Equal(0.990, lcs.ComputeDistance(sx99, s), precision: 3); 331Assert.Equal(1.000, lcs.ComputeDistance(sx1000, s), precision: 3); 332Assert.Equal(1.000, lcs.ComputeDistance(sx100000000, s), precision: 3); 334Assert.Equal(1.000, lcs.ComputeDistance(x10 + y1000, x10), precision: 3); 335Assert.Equal(0.5, lcs.ComputeDistance(x1000 + y1000, x1000), precision: 3);