Skip to content

Commit

Permalink
Builder tests
Browse files Browse the repository at this point in the history
  • Loading branch information
zix99 committed Jan 2, 2025
1 parent af01c66 commit 57d1cfc
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion cmd/helpers/extractorBuilder_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,10 @@ func TestBuildingExtractorFromContext(t *testing.T) {
assert.NoError(t, runApp(""))
assert.NoError(t, runApp(`-I -i "{eq {0} abc}" ../testdata/log.txt`))
assert.NoError(t, runApp(`-f ../testdata/log.txt`))
assert.NoError(t, runApp(`-m ".*" ../testdata/log.txt`))
assert.NoError(t, runApp(`-I -m ".*" ../testdata/log.txt`))
assert.NoError(t, runApp(`-d "%{}" ../testdata/log.txt`))
assert.NoError(t, runApp(`-I -d "%{}" ../testdata/log.txt`))
testLogFatal(t, 2, func() {
runApp("--batch 0 ../testdata/log.txt")
})
Expand All @@ -77,5 +81,11 @@ func TestBuildingExtractorFromContext(t *testing.T) {
testLogFatal(t, 2, func() {
runApp(`-i "{0" -`)
})
assert.Equal(t, 3, actionCalled)
testLogFatal(t, 2, func() {
runApp(`-m regex -d dissect -`)
})
testLogFatal(t, 2, func() {
runApp(`-d "%{unclosed" -`)
})
assert.Equal(t, 7, actionCalled)
}

0 comments on commit 57d1cfc

Please sign in to comment.