mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-23 03:41:45 +00:00
json: test handling of duplicate keys
We want to see in the output when keys are used more than once. This should be fixed because parsing the log messages as JSON will only preserve one of the values.
This commit is contained in:
parent
ab318cf89f
commit
ef30d845d9
@ -65,6 +65,11 @@ func TestZapLoggerInfo(t *testing.T) {
|
||||
names: []string{"hello", "world"},
|
||||
format: "{\"ts\":%f,\"logger\":\"hello.world\",\"caller\":\"json/json_test.go:%d\",\"msg\":\"test for WithName\",\"v\":0}\n",
|
||||
},
|
||||
{
|
||||
msg: "test for duplicate keys",
|
||||
format: "{\"ts\":%f,\"caller\":\"json/json_test.go:%d\",\"msg\":\"test for duplicate keys\",\"v\":0,\"akey\":\"avalue\",\"akey\":\"anothervalue\"}\n",
|
||||
keysValues: []interface{}{"akey", "avalue", "akey", "anothervalue"},
|
||||
},
|
||||
}
|
||||
|
||||
for _, data := range testDataInfo {
|
||||
|
Loading…
Reference in New Issue
Block a user