testutil

package
v1.14.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 19, 2020 License: AGPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckPantherMultiline added in v1.5.0

func CheckPantherMultiline(t *testing.T, logs string, parser parsers.LogParser, expect ...*parsers.PantherLog)

func CheckPantherParser added in v1.1.0

func CheckPantherParser(t *testing.T, log string, parser parsers.LogParser, expect *parsers.PantherLog, expectMore ...*parsers.PantherLog)

func CheckParserSamplesJSONL added in v1.7.0

func CheckParserSamplesJSONL(t *testing.T, filename string, parser parsers.LogParser)

func EqualPantherLog

func EqualPantherLog(t *testing.T, expectedEvent *parsers.PantherLog, events []*parsers.PantherLog, parseErr error)

For new parser tests use `CheckPantherParser` instead Used by log parsers to validate records

func MustReadFileJSONLines added in v1.2.1

func MustReadFileJSONLines(filename string) (lines []string)

func MustReadFileString added in v1.2.1

func MustReadFileString(filename string) string

func NewRawMessage added in v1.6.0

func NewRawMessage(jsonString string) *jsoniter.RawMessage

Types

type MockParser added in v1.5.1

type MockParser struct {
	mock.Mock
}

func AlwaysFailParser added in v1.5.1

func AlwaysFailParser(err error) *MockParser

func (*MockParser) ParseLog added in v1.5.1

func (p *MockParser) ParseLog(log string) ([]*parsers.Result, error)

func (*MockParser) RequireLessOrEqualNumberOfCalls added in v1.5.1

func (p *MockParser) RequireLessOrEqualNumberOfCalls(t *testing.T, method string, number int)

type ParserConfig added in v1.5.1

type ParserConfig map[string]interface{}

func (ParserConfig) Parser added in v1.5.1

func (args ParserConfig) Parser() *MockParser

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL