Add extra tags config test
This commit is contained in:
1 parent
b05ed0bf65
commit
17ad2410cd
1 file changed
+25
@@ -140,6 +140,31 @@ func TestDevWorker(t *testing.T) {
|
||||
exp.Worker.TagsRaw = actual.Worker.TagsRaw
|
||||
assert.Equal(t, exp, actual)
|
||||
|
||||
// Handle when there is a singular value not indicated as a slice
|
||||
devWorkerKeyValueConfig = `
|
||||
listener "tcp" {
|
||||
purpose = "proxy"
|
||||
}
|
||||
|
||||
worker {
|
||||
name = "dev-worker"
|
||||
description = "A default worker created in dev mode"
|
||||
controllers = ["127.0.0.1"]
|
||||
tags {
|
||||
type = "local"
|
||||
}
|
||||
}
|
||||
`
|
||||
|
||||
actual, err = Parse(devConfig + devWorkerKeyValueConfig)
|
||||
assert.NoError(t, err)
|
||||
exp.Listeners[0].RawConfig = actual.Listeners[0].RawConfig
|
||||
exp.Worker.TagsRaw = actual.Worker.TagsRaw
|
||||
prevTags := exp.Worker.Tags
|
||||
exp.Worker.Tags = map[string][]string{"type": {"local"}}
|
||||
assert.Equal(t, exp, actual)
|
||||
exp.Worker.Tags = prevTags
|
||||
|
||||
// Redo it with non-lower-cased keys
|
||||
devWorkerKeyValueConfig = `
|
||||
listener "tcp" {
|
||||
|
||||
Reference in new issue
Block a user