From 39919d868e0c9919450c9c26becb5ea702a0909e Mon Sep 17 00:00:00 2001 From: Patrick Ohly Date: Fri, 10 Dec 2021 12:05:44 +0100 Subject: [PATCH] add format test for KObjs This wasn't covered before. At first glance the different formatting of the individual objects (no quotation marks) looks a bit odd compared to how KObj is formatted, but that's what we have right now. --- klog_test.go | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/klog_test.go b/klog_test.go index 9a44c6be..4246e344 100644 --- a/klog_test.go +++ b/klog_test.go @@ -1107,6 +1107,18 @@ func TestKvListFormat(t *testing.T) { keysValues: []interface{}{"pod", KObj((*kMetadataMock)(nil)), "status", "ready"}, want: " pod=\"\" status=\"ready\"", }, + { + keysValues: []interface{}{"pods", KObjs([]kMetadataMock{ + { + name: "kube-dns", + ns: "kube-system", + }, + { + name: "mi-conf", + }, + })}, + want: " pods=[kube-system/kube-dns mi-conf]", + }, } for _, d := range testKVList {