mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Fix broken JSON support in cli/command/formatter
How to test:
$ docker ps --format '{{json .}}'
$ docker network ls --format '{{json .}}'
$ docker volume ls --format '{{json .}}'
Signed-off-by: Akihiro Suda <suda.akihiro@lab.ntt.co.jp>
This commit is contained in:
parent
a2ad359730
commit
3a32b58792
11 changed files with 334 additions and 7 deletions
|
|
@ -4,6 +4,7 @@ package assert
|
|||
import (
|
||||
"fmt"
|
||||
"path/filepath"
|
||||
"reflect"
|
||||
"runtime"
|
||||
"strings"
|
||||
)
|
||||
|
|
@ -44,6 +45,14 @@ func NilError(t TestingT, err error) {
|
|||
}
|
||||
}
|
||||
|
||||
// DeepEqual compare the actual value to the expected value and fails the test if
|
||||
// they are not "deeply equal".
|
||||
func DeepEqual(t TestingT, actual, expected interface{}) {
|
||||
if !reflect.DeepEqual(actual, expected) {
|
||||
fatal(t, "Expected '%v' (%T) got '%v' (%T)", expected, expected, actual, actual)
|
||||
}
|
||||
}
|
||||
|
||||
// Error asserts that error is not nil, and contains the expected text,
|
||||
// otherwise it fails the test.
|
||||
func Error(t TestingT, err error, contains string) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue