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

Function TestWithAsciiBJunk

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

Source from the content-addressed store, hash-verified

236}
237
238func TestWithAsciiBJunk(t *testing.T) {
239 isJunk := func(s string) bool {
240 return s == " "
241 }
242 sm := NewMatcherWithJunk(splitChars(rep("a", 40)+rep("b", 40)),
243 splitChars(rep("a", 44)+rep("b", 40)), true, isJunk)
244 assertEqual(t, sm.bJunk, map[string]struct{}{})
245
246 sm = NewMatcherWithJunk(splitChars(rep("a", 40)+rep("b", 40)),
247 splitChars(rep("a", 44)+rep("b", 40)+rep(" ", 20)), false, isJunk)
248 assertEqual(t, sm.bJunk, map[string]struct{}{" ": struct{}{}})
249
250 isJunk = func(s string) bool {
251 return s == " " || s == "b"
252 }
253 sm = NewMatcherWithJunk(splitChars(rep("a", 40)+rep("b", 40)),
254 splitChars(rep("a", 44)+rep("b", 40)+rep(" ", 20)), false, isJunk)
255 assertEqual(t, sm.bJunk, map[string]struct{}{" ": struct{}{}, "b": struct{}{}})
256}
257
258func TestSFBugsRatioForNullSeqn(t *testing.T) {
259 sm := NewMatcher(nil, nil)

Callers

nothing calls this directly

Calls 4

NewMatcherWithJunkFunction · 0.85
splitCharsFunction · 0.85
repFunction · 0.85
assertEqualFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…