(t *testing.T)
| 212 | } |
| 213 | |
| 214 | func TestWithAsciiOneInsert(t *testing.T) { |
| 215 | sm := NewMatcher(splitChars(rep("b", 100)), |
| 216 | splitChars("a"+rep("b", 100))) |
| 217 | assertAlmostEqual(t, sm.Ratio(), 0.995, 3) |
| 218 | assertEqual(t, sm.GetOpCodes(), |
| 219 | []OpCode{{'i', 0, 0, 0, 1}, {'e', 0, 100, 1, 101}}) |
| 220 | assertEqual(t, len(sm.bPopular), 0) |
| 221 | |
| 222 | sm = NewMatcher(splitChars(rep("b", 100)), |
| 223 | splitChars(rep("b", 50)+"a"+rep("b", 50))) |
| 224 | assertAlmostEqual(t, sm.Ratio(), 0.995, 3) |
| 225 | assertEqual(t, sm.GetOpCodes(), |
| 226 | []OpCode{{'e', 0, 50, 0, 50}, {'i', 50, 50, 50, 51}, {'e', 50, 100, 51, 101}}) |
| 227 | assertEqual(t, len(sm.bPopular), 0) |
| 228 | } |
| 229 | |
| 230 | func TestWithAsciiOnDelete(t *testing.T) { |
| 231 | sm := NewMatcher(splitChars(rep("a", 40)+"c"+rep("b", 40)), |
nothing calls this directly
no test coverage detected
searching dependent graphs…