stackdriver: fix broken substring. also adds tests

(cherry picked from commit 68332c5951)
This commit is contained in:
Erik Sundell
2018-10-02 17:29:51 +02:00
committed by bergquist
parent 897cf51e75
commit dee26f3d2f
2 changed files with 18 additions and 2 deletions
+13
View File
@@ -384,6 +384,19 @@ func TestStackdriver(t *testing.T) {
})
})
Convey("when interpolating filter wildcards", func() {
Convey("and wildcard is used in the beginning and the end of the word", func() {
Convey("and theres no wildcard in the middle of the word", func() {
value := interpolateFilterWildcards("*-central1*")
So(value, ShouldEqual, `has_substring("-central1")`)
})
Convey("and there is a wildcard in the middle of the word", func() {
value := interpolateFilterWildcards("*-cent*ral1*")
So(value, ShouldNotStartWith, `has_substring`)
})
})
})
})
}