We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1cf8046 commit 5bd5770Copy full SHA for 5bd5770
internal/cli/main_test.go
@@ -18,6 +18,7 @@ package cli
18
19
import (
20
"bytes"
21
+ "encoding/json"
22
"io/ioutil"
23
"path/filepath"
24
"testing"
@@ -233,6 +234,18 @@ func TestFieldSet(t *testing.T) {
233
234
t.Errorf("unexpected error: %v", err)
235
}
236
tt.checkOutput(t, b.Bytes())
237
+
238
+ // Test that round tripping through unstructured will preserve ordering
239
+ u := map[string]interface{}{}
240
+ err = json.Unmarshal(b.Bytes(), &u)
241
+ if err != nil {
242
+ t.Errorf("unexpected error: %v", err)
243
+ }
244
+ m, err := json.Marshal(&u)
245
246
247
248
+ tt.checkOutput(t, m)
249
})
250
251
0 commit comments