Skip to content

Commit

Permalink
go fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
fstab committed Jul 28, 2016
1 parent 562edce commit f06030d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions exporter/grok_test.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package exporter

import (
"testing"
"strings"
"testing"
)

func TestAllRegexpsCompile(t *testing.T) {
Expand All @@ -18,15 +18,15 @@ func TestAllRegexpsCompile(t *testing.T) {
func TestUnknownGrokPattern(t *testing.T) {
patterns := loadPatternDir(t)
_, err := Compile("%{USER} [a-z] %{SOME_UNKNOWN_PATTERN}.*", patterns)
if err == nil || ! strings.Contains(err.Error(), "SOME_UNKNOWN_PATTERN") {
if err == nil || !strings.Contains(err.Error(), "SOME_UNKNOWN_PATTERN") {
t.Error("expected error message saying which pattern is undefined.")
}
}

func TestInvalidRegexp(t *testing.T) {
patterns := loadPatternDir(t)
_, err := Compile("%{USER} [a-z] \\", patterns) // wrong because regex cannot end with backslash
if err == nil || ! strings.Contains(err.Error(), "%{USER} [a-z] \\") {
if err == nil || !strings.Contains(err.Error(), "%{USER} [a-z] \\") {
t.Error("expected error message saying which pattern is invalid.")
}
}
Expand Down

0 comments on commit f06030d

Please sign in to comment.