diff options
author | Qi Wang <qiwan@redhat.com> | 2019-03-11 12:14:29 -0400 |
---|---|---|
committer | Qi Wang <qiwan@redhat.com> | 2019-03-11 14:44:59 -0400 |
commit | e3d8e79d9569f3e328facac7978ed3c2ad786eb7 (patch) | |
tree | 66bf7b77bdb73aa25f2f3e0b54a2a26195afc3fc /cmd/podman/formats/formats_test.go | |
parent | 6421208e0f6ff1fba58eafdab12e897b5ed12e3b (diff) | |
download | podman-e3d8e79d9569f3e328facac7978ed3c2ad786eb7.tar.gz podman-e3d8e79d9569f3e328facac7978ed3c2ad786eb7.tar.bz2 podman-e3d8e79d9569f3e328facac7978ed3c2ad786eb7.zip |
move formats pkg to and vendor from buildah
Signed-off-by: Qi Wang <qiwan@redhat.com>
Diffstat (limited to 'cmd/podman/formats/formats_test.go')
-rw-r--r-- | cmd/podman/formats/formats_test.go | 42 |
1 files changed, 0 insertions, 42 deletions
diff --git a/cmd/podman/formats/formats_test.go b/cmd/podman/formats/formats_test.go deleted file mode 100644 index c75109d65..000000000 --- a/cmd/podman/formats/formats_test.go +++ /dev/null @@ -1,42 +0,0 @@ -package formats - -import ( - "bytes" - "strings" - "testing" - - "github.com/containers/libpod/pkg/inspect" -) - -func TestSetJSONFormatEncoder(t *testing.T) { - tt := []struct { - name string - imageData *inspect.ImageData - expected string - isTerminal bool - }{ - { - name: "HTML tags are not escaped", - imageData: &inspect.ImageData{Author: "dave <dave@corp.io>"}, - expected: `"Author": "dave <dave@corp.io>"`, - isTerminal: true, - }, - { - name: "HTML tags are escaped", - imageData: &inspect.ImageData{Author: "dave <dave@corp.io>"}, - expected: `"Author": "dave \u003cdave@corp.io\u003e"`, - isTerminal: false, - }, - } - - for _, tc := range tt { - buf := bytes.NewBuffer(nil) - enc := setJSONFormatEncoder(tc.isTerminal, buf) - if err := enc.Encode(tc.imageData); err != nil { - t.Errorf("test %#v failed encoding: %s", tc.name, err) - } - if !strings.Contains(buf.String(), tc.expected) { - t.Errorf("test %#v expected output to contain %#v. Output:\n%v\n", tc.name, tc.expected, buf.String()) - } - } -} |