1 // Copyright (C) The Arvados Authors. All rights reserved.
3 // SPDX-License-Identifier: AGPL-3.0
8 check "gopkg.in/check.v1"
11 var _ = check.Suite(&logScannerSuite{})
13 type logScannerSuite struct {
16 func (s *logScannerSuite) TestCallReportFuncOnce(c *check.C) {
19 Patterns: []string{"foobar", "barbaz"},
20 ReportFunc: func(pattern string) {
21 reported = append(reported, pattern)
24 ls.Write([]byte("foo\nbar\nbar"))
25 ls.Write([]byte("baz\nwaz\nqux"))
26 ls.Write([]byte("\nfoobar\n"))
27 c.Check(reported, check.DeepEquals, []string{"barbaz"})