stackdriver: fix broken substring. also adds tests

This commit is contained in:
Erik Sundell
2018-10-08 15:57:30 +02:00
parent 2e665fba0f
commit 68332c5951
2 changed files with 18 additions and 2 deletions
+13
View File
@@ -342,6 +342,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`)
})
})
})
})
}