Added unit test on key length

This commit is contained in:
Pierre Souchay 2018-04-18 23:07:25 +02:00
parent ef7a35b203
commit 6e71d8bb44
1 changed files with 14 additions and 1 deletions

View File

@ -1940,7 +1940,20 @@ func TestConfigFlagsAndEdgecases(t *testing.T) {
},
},
{
desc: "service with wrong meta: too long",
desc: "service with wrong meta: too long key",
args: []string{
`-data-dir=` + dataDir,
},
json: []string{
`{ "service": { "name": "a", "port": 80, "meta": { "` + randomString(520) + `": "metaValue" } } }`,
},
hcl: []string{
`service = { name = "a" port = 80, meta={` + randomString(520) + `="metaValue"} }`,
},
err: `Key is too long`,
},
{
desc: "service with wrong meta: too long value",
args: []string{
`-data-dir=` + dataDir,
},