MCPcopy Create free account
hub / github.com/cogentcore/core / TestWithAsciiBJunk

Function TestWithAsciiBJunk

texteditor/difflib/difflib_test.go:248–266  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

246}
247
248func TestWithAsciiBJunk(t *testing.T) {
249 isJunk := func(s string) bool {
250 return s == " "
251 }
252 sm := NewMatcherWithJunk(splitChars(rep("a", 40)+rep("b", 40)),
253 splitChars(rep("a", 44)+rep("b", 40)), true, isJunk)
254 assertEqual(t, sm.bJunk, map[string]bool{})
255
256 sm = NewMatcherWithJunk(splitChars(rep("a", 40)+rep("b", 40)),
257 splitChars(rep("a", 44)+rep("b", 40)+rep(" ", 20)), false, isJunk)
258 assertEqual(t, sm.bJunk, map[string]bool{" ": true})
259
260 isJunk = func(s string) bool {
261 return s == " " || s == "b"
262 }
263 sm = NewMatcherWithJunk(splitChars(rep("a", 40)+rep("b", 40)),
264 splitChars(rep("a", 44)+rep("b", 40)+rep(" ", 20)), false, isJunk)
265 assertEqual(t, sm.bJunk, map[string]bool{" ": true, "b": true})
266}
267
268func TestSFBugsRatioForNullSeqn(t *testing.T) {
269 sm := NewMatcher(nil, nil)

Callers

nothing calls this directly

Calls 4

NewMatcherWithJunkFunction · 0.70
splitCharsFunction · 0.70
repFunction · 0.70
assertEqualFunction · 0.70

Tested by

no test coverage detected