Remove unnessary abstraction deepEqual
Docker-DCO-1.1-Signed-off-by: Jessica Frazelle <jess@docker.com> (github: jfrazelle)
This commit is contained in:
parent
02a021119f
commit
fa753e67ae
|
@ -9,6 +9,7 @@ import (
|
||||||
"os/exec"
|
"os/exec"
|
||||||
"path"
|
"path"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
|
"reflect"
|
||||||
"regexp"
|
"regexp"
|
||||||
"strings"
|
"strings"
|
||||||
"syscall"
|
"syscall"
|
||||||
|
@ -1569,7 +1570,7 @@ func TestBuildWithVolumes(t *testing.T) {
|
||||||
t.Fatal(err)
|
t.Fatal(err)
|
||||||
}
|
}
|
||||||
|
|
||||||
equal := deepEqual(&expected, &result)
|
equal := reflect.DeepEqual(&result, &expected)
|
||||||
|
|
||||||
if !equal {
|
if !equal {
|
||||||
t.Fatalf("Volumes %s, expected %s", result, expected)
|
t.Fatalf("Volumes %s, expected %s", result, expected)
|
||||||
|
|
|
@ -4,6 +4,7 @@ import (
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
"os"
|
"os"
|
||||||
"os/exec"
|
"os/exec"
|
||||||
|
"reflect"
|
||||||
"strings"
|
"strings"
|
||||||
"testing"
|
"testing"
|
||||||
"time"
|
"time"
|
||||||
|
@ -121,7 +122,7 @@ func TestLinksInspectLinksStarted(t *testing.T) {
|
||||||
|
|
||||||
output := convertSliceOfStringsToMap(result)
|
output := convertSliceOfStringsToMap(result)
|
||||||
|
|
||||||
equal := deepEqual(expected, output)
|
equal := reflect.DeepEqual(output, expected)
|
||||||
|
|
||||||
if !equal {
|
if !equal {
|
||||||
t.Fatalf("Links %s, expected %s", result, expected)
|
t.Fatalf("Links %s, expected %s", result, expected)
|
||||||
|
@ -150,7 +151,7 @@ func TestLinksInspectLinksStopped(t *testing.T) {
|
||||||
|
|
||||||
output := convertSliceOfStringsToMap(result)
|
output := convertSliceOfStringsToMap(result)
|
||||||
|
|
||||||
equal := deepEqual(expected, output)
|
equal := reflect.DeepEqual(output, expected)
|
||||||
|
|
||||||
if !equal {
|
if !equal {
|
||||||
t.Fatalf("Links %s, but expected %s", result, expected)
|
t.Fatalf("Links %s, but expected %s", result, expected)
|
||||||
|
|
|
@ -114,10 +114,6 @@ func unmarshalJSON(data []byte, result interface{}) error {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func deepEqual(expected interface{}, result interface{}) bool {
|
|
||||||
return reflect.DeepEqual(result, expected)
|
|
||||||
}
|
|
||||||
|
|
||||||
func convertSliceOfStringsToMap(input []string) map[string]struct{} {
|
func convertSliceOfStringsToMap(input []string) map[string]struct{} {
|
||||||
output := make(map[string]struct{})
|
output := make(map[string]struct{})
|
||||||
for _, v := range input {
|
for _, v := range input {
|
||||||
|
|
Loading…
Reference in New Issue