MCPcopy Index your code
hub / github.com/expr-lang/expr / TestWithAsciiOneInsert

Function TestWithAsciiOneInsert

internal/difflib/difflib_test.go:214–228  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

212}
213
214func 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
230func TestWithAsciiOnDelete(t *testing.T) {
231 sm := NewMatcher(splitChars(rep("a", 40)+"c"+rep("b", 40)),

Callers

nothing calls this directly

Calls 7

NewMatcherFunction · 0.85
splitCharsFunction · 0.85
repFunction · 0.85
assertAlmostEqualFunction · 0.85
assertEqualFunction · 0.85
RatioMethod · 0.80
GetOpCodesMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…