MCPcopy Create free account
hub / github.com/rabbitstack/fibratus / TestParseSequence

Function TestParseSequence

pkg/filter/ql/parser_test.go:229–415  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

227}
228
229func TestParseSequence(t *testing.T) {
230 var tests = []struct {
231 expr string
232 err error
233 maxSpan time.Duration
234 isConstrained bool
235 }{
236 {
237 `evt.name = 'CreateProcess'|
238 |evt.name = 'CreateFile'|
239 `,
240 errors.New("expected |"),
241 time.Duration(0),
242 false,
243 },
244 {
245 `|evt.name = 'CreateProcess'
246 evt.name = 'CreateFile'|
247 `,
248 errors.New("expected operator, ')', ',', '|'"),
249 time.Duration(0),
250 false,
251 },
252 {
253 `|evt.name = 'CreateProcess'|
254 |evt.name = 'CreateFile'
255 `,
256 errors.New("expected |"),
257 time.Duration(0),
258 false,
259 },
260 {
261 `|evt.name = 'CreateProcess'|
262 |evt.name = 'CreateFile'|
263 `,
264 nil,
265 time.Duration(0),
266 false,
267 },
268 {
269 `|evt.name = 'CreateProcess'| by ps.exe
270 |evt.name = 'CreateFile'| by file.name
271 `,
272 nil,
273 time.Duration(0),
274 true,
275 },
276 {
277 `|evt.name = 'CreateProcess'| by ps.exe, ps.uuid
278 |evt.name = 'CreateFile'| by file.name, ps.uuid
279 `,
280 nil,
281 time.Duration(0),
282 true,
283 },
284 {
285 `by ps.exe, ps.uuid
286 |evt.name = 'CreateProcess'|

Callers

nothing calls this directly

Calls 5

ParseSequenceMethod · 0.95
NewParserFunction · 0.85
ContainsMethod · 0.80
IsConstrainedMethod · 0.80
ErrorMethod · 0.45

Tested by

no test coverage detected