mirror of
https://github.com/grafana/grafana.git
synced 2025-08-03 05:37:53 +08:00
Config Array Syntax (#8204)
* refactor util encryption library so it doesn't have to import log * add util.SplitString to handle space and/or comma-separated config lines * go fmt
This commit is contained in:

committed by
Torkel Ödegaard

parent
d085aaad41
commit
b489e93d94
@ -13,3 +13,14 @@ func TestStringsUtil(t *testing.T) {
|
||||
So(StringsFallback3("", "", "3"), ShouldEqual, "3")
|
||||
})
|
||||
}
|
||||
|
||||
func TestSplitString(t *testing.T) {
|
||||
Convey("Splits strings correctly", t, func() {
|
||||
So(SplitString(""), ShouldResemble, []string{})
|
||||
So(SplitString("test"), ShouldResemble, []string{"test"})
|
||||
So(SplitString("test1 test2 test3"), ShouldResemble, []string{"test1", "test2", "test3"})
|
||||
So(SplitString("test1,test2,test3"), ShouldResemble, []string{"test1", "test2", "test3"})
|
||||
So(SplitString("test1, test2, test3"), ShouldResemble, []string{"test1", "test2", "test3"})
|
||||
So(SplitString("test1 , test2 test3"), ShouldResemble, []string{"test1", "test2", "test3"})
|
||||
})
|
||||
}
|
||||
|
Reference in New Issue
Block a user