(t *testing.T)
| 284 | } |
| 285 | |
| 286 | func TestWithAsciiBJunk(t *testing.T) { |
| 287 | isJunk := func(s []byte) bool { |
| 288 | return len(s) == 1 && s[0] == ' ' |
| 289 | } |
| 290 | sm := NewMatcherWithJunk(splitChars(rep("a", 40)+rep("b", 40)), |
| 291 | splitChars(rep("a", 44)+rep("b", 40)), true, isJunk) |
| 292 | assertEqual(t, getall(&sm.b2j, lineJUNK), [][]byte{}) |
| 293 | |
| 294 | sm = NewMatcherWithJunk(splitChars(rep("a", 40)+rep("b", 40)), |
| 295 | splitChars(rep("a", 44)+rep("b", 40)+rep(" ", 20)), false, isJunk) |
| 296 | assertEqual(t, getall(&sm.b2j, lineJUNK), [][]byte{SPACE}) |
| 297 | |
| 298 | isJunk = func(s []byte) bool { |
| 299 | return len(s) == 1 && (s[0] == ' ' || s[0] == 'b') |
| 300 | } |
| 301 | sm = NewMatcherWithJunk(splitChars(rep("a", 40)+rep("b", 40)), |
| 302 | splitChars(rep("a", 44)+rep("b", 40)+rep(" ", 20)), false, isJunk) |
| 303 | assertEqual(t, getall(&sm.b2j, lineJUNK), [][]byte{{'b'}, SPACE}) |
| 304 | } |
| 305 | |
| 306 | func TestSFBugsRatioForNullSeqn(t *testing.T) { |
| 307 | sm := NewMatcher(nil, nil) |
nothing calls this directly
no test coverage detected