-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add canned log handling for unittesting main, some cleanup related to it
- Loading branch information
Showing
15 changed files
with
346 additions
and
183 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
/* | ||
* Author: Markus Stenberg <[email protected]> | ||
* | ||
* Copyright (c) 2024 Markus Stenberg | ||
* | ||
* Created: Sun Jun 9 20:38:22 2024 mstenber | ||
* Last modified: Sun Jun 9 20:42:07 2024 mstenber | ||
* Edit time: 3 min | ||
* | ||
*/ | ||
|
||
package data | ||
|
||
import ( | ||
"testing" | ||
|
||
"gotest.tools/v3/assert" | ||
) | ||
|
||
func TestLogRule(t *testing.T) { | ||
lr := LogRule{Matchers: []LogFieldMatcher{ | ||
{"source", "=", "dummysrc", nil}, | ||
{"message", "=", "dummymessage", nil}, | ||
}} | ||
assert.Assert(t, lr.MatchesFTS("dummysrc")) | ||
assert.Assert(t, lr.MatchesFTS("dummymessage")) | ||
assert.Assert(t, !lr.MatchesFTS("dummynonexistent")) | ||
assert.Equal(t, lr.SourceString(), "=dummysrc") | ||
} |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.