@@ -43,31 +43,37 @@ TEST(SampleProfileMatcherTests, MyersDiffTest1) {
43
43
44
44
std::vector<Anchor> AnchorsA;
45
45
std::vector<Anchor> AnchorsB;
46
- auto R = Diff.shortestEdit (AnchorsA, AnchorsB);
46
+ auto R = Diff.longestCommonSequence (AnchorsA, AnchorsB);
47
47
EXPECT_TRUE (R.EqualLocations .empty ());
48
+ #ifndef NDEBUG
48
49
EXPECT_TRUE (R.Deletions .empty ());
49
50
EXPECT_TRUE (R.Insertions .empty ());
51
+ #endif
50
52
}
51
53
52
54
TEST (SampleProfileMatcherTests, MyersDiffTest2) {
53
55
std::vector<std::string> A ({" a" , " b" , " c" });
54
56
std::vector<Anchor> AnchorsA = createAnchorsFromStrings (A);
55
57
std::vector<Anchor> AnchorsB;
56
- auto R = Diff.shortestEdit (AnchorsA, AnchorsB);
58
+ auto R = Diff.longestCommonSequence (AnchorsA, AnchorsB);
57
59
EXPECT_TRUE (R.EqualLocations .empty ());
60
+ #ifndef NDEBUG
58
61
EXPECT_EQ (R.Insertions , createLocations (std::vector<uint32_t >({2 , 1 , 0 })));
59
62
EXPECT_TRUE (R.Deletions .empty ());
63
+ #endif
60
64
}
61
65
62
66
TEST (SampleProfileMatcherTests, MyersDiffTest3) {
63
67
64
68
std::vector<Anchor> AnchorsA;
65
69
std::vector<std::string> B ({" a" , " b" , " c" });
66
70
std::vector<Anchor> AnchorsB = createAnchorsFromStrings (B);
67
- auto R = Diff.shortestEdit (AnchorsA, AnchorsB);
71
+ auto R = Diff.longestCommonSequence (AnchorsA, AnchorsB);
68
72
EXPECT_TRUE (R.EqualLocations .empty ());
73
+ #ifndef NDEBUG
69
74
EXPECT_TRUE (R.Insertions .empty ());
70
75
EXPECT_EQ (R.Deletions , createLocations (std::vector<uint32_t >({2 , 1 , 0 })));
76
+ #endif
71
77
}
72
78
73
79
TEST (SampleProfileMatcherTests, MyersDiffTest4) {
@@ -77,10 +83,12 @@ TEST(SampleProfileMatcherTests, MyersDiffTest4) {
77
83
std::vector<Anchor> AnchorsB = createAnchorsFromStrings (B);
78
84
LocToLocMap ExpectEqualLocations =
79
85
createEqualLocations ({{0 , 0 }, {1 , 1 }, {2 , 2 }});
80
- auto R = Diff.shortestEdit (AnchorsA, AnchorsB);
86
+ auto R = Diff.longestCommonSequence (AnchorsA, AnchorsB);
81
87
EXPECT_EQ (R.EqualLocations , ExpectEqualLocations);
88
+ #ifndef NDEBUG
82
89
EXPECT_TRUE (R.Insertions .empty ());
83
90
EXPECT_TRUE (R.Deletions .empty ());
91
+ #endif
84
92
}
85
93
86
94
TEST (SampleProfileMatcherTests, MyersDiffTest5) {
@@ -89,10 +97,12 @@ TEST(SampleProfileMatcherTests, MyersDiffTest5) {
89
97
std::vector<Anchor> AnchorsA = createAnchorsFromStrings (A);
90
98
std::vector<Anchor> AnchorsB = createAnchorsFromStrings (B);
91
99
LocToLocMap ExpectEqualLocations = createEqualLocations ({{1 , 0 }, {2 , 1 }});
92
- auto R = Diff.shortestEdit (AnchorsA, AnchorsB);
100
+ auto R = Diff.longestCommonSequence (AnchorsA, AnchorsB);
93
101
EXPECT_EQ (R.EqualLocations , ExpectEqualLocations);
102
+ #ifndef NDEBUG
94
103
EXPECT_EQ (R.Insertions , createLocations (std::vector<uint32_t >({0 })));
95
104
EXPECT_EQ (R.Deletions , createLocations (std::vector<uint32_t >({2 })));
105
+ #endif
96
106
}
97
107
98
108
TEST (SampleProfileMatcherTests, MyersDiffTest6) {
@@ -101,10 +111,12 @@ TEST(SampleProfileMatcherTests, MyersDiffTest6) {
101
111
std::vector<Anchor> AnchorsA = createAnchorsFromStrings (A);
102
112
std::vector<Anchor> AnchorsB = createAnchorsFromStrings (B);
103
113
LocToLocMap ExpectEqualLocations = createEqualLocations ({{0 , 0 }, {2 , 2 }});
104
- auto R = Diff.shortestEdit (AnchorsA, AnchorsB);
114
+ auto R = Diff.longestCommonSequence (AnchorsA, AnchorsB);
105
115
EXPECT_EQ (R.EqualLocations , ExpectEqualLocations);
116
+ #ifndef NDEBUG
106
117
EXPECT_EQ (R.Insertions , createLocations (std::vector<uint32_t >({1 })));
107
118
EXPECT_EQ (R.Deletions , createLocations (std::vector<uint32_t >({1 })));
119
+ #endif
108
120
}
109
121
110
122
TEST (SampleProfileMatcherTests, MyersDiffTest7) {
@@ -114,10 +126,12 @@ TEST(SampleProfileMatcherTests, MyersDiffTest7) {
114
126
std::vector<Anchor> AnchorsB = createAnchorsFromStrings (B);
115
127
LocToLocMap ExpectEqualLocations =
116
128
createEqualLocations ({{2 , 0 }, {3 , 2 }, {4 , 3 }, {6 , 4 }});
117
- auto R = Diff.shortestEdit (AnchorsA, AnchorsB);
129
+ auto R = Diff.longestCommonSequence (AnchorsA, AnchorsB);
118
130
EXPECT_EQ (R.EqualLocations , ExpectEqualLocations);
131
+ #ifndef NDEBUG
119
132
EXPECT_EQ (R.Insertions , createLocations (std::vector<uint32_t >({5 , 1 , 0 })));
120
133
EXPECT_EQ (R.Deletions , createLocations (std::vector<uint32_t >({5 , 1 })));
134
+ #endif
121
135
}
122
136
123
137
TEST (SampleProfileMatcherTests, MyersDiffTest8) {
@@ -127,8 +141,10 @@ TEST(SampleProfileMatcherTests, MyersDiffTest8) {
127
141
std::vector<Anchor> AnchorsB = createAnchorsFromStrings (B);
128
142
LocToLocMap ExpectEqualLocations =
129
143
createEqualLocations ({{0 , 0 }, {2 , 1 }, {3 , 2 }, {4 , 5 }, {5 , 8 }});
130
- auto R = Diff.shortestEdit (AnchorsA, AnchorsB);
144
+ auto R = Diff.longestCommonSequence (AnchorsA, AnchorsB);
131
145
EXPECT_EQ (R.EqualLocations , ExpectEqualLocations);
146
+ #ifndef NDEBUG
132
147
EXPECT_EQ (R.Insertions , createLocations (std::vector<uint32_t >({6 , 1 })));
133
148
EXPECT_EQ (R.Deletions , createLocations (std::vector<uint32_t >({7 , 6 , 4 , 3 })));
149
+ #endif
134
150
}
0 commit comments