1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00

Remove unnessary abstraction deepEqual

Docker-DCO-1.1-Signed-off-by: Jessica Frazelle <jess@docker.com> (github: jfrazelle)
This commit is contained in:
Jessica Frazelle 2014-12-03 17:52:06 -08:00
parent 02a021119f
commit fa753e67ae
3 changed files with 5 additions and 7 deletions

View file

@ -9,6 +9,7 @@ import (
"os/exec"
"path"
"path/filepath"
"reflect"
"regexp"
"strings"
"syscall"
@ -1569,7 +1570,7 @@ func TestBuildWithVolumes(t *testing.T) {
t.Fatal(err)
}
equal := deepEqual(&expected, &result)
equal := reflect.DeepEqual(&result, &expected)
if !equal {
t.Fatalf("Volumes %s, expected %s", result, expected)

View file

@ -4,6 +4,7 @@ import (
"io/ioutil"
"os"
"os/exec"
"reflect"
"strings"
"testing"
"time"
@ -121,7 +122,7 @@ func TestLinksInspectLinksStarted(t *testing.T) {
output := convertSliceOfStringsToMap(result)
equal := deepEqual(expected, output)
equal := reflect.DeepEqual(output, expected)
if !equal {
t.Fatalf("Links %s, expected %s", result, expected)
@ -150,7 +151,7 @@ func TestLinksInspectLinksStopped(t *testing.T) {
output := convertSliceOfStringsToMap(result)
equal := deepEqual(expected, output)
equal := reflect.DeepEqual(output, expected)
if !equal {
t.Fatalf("Links %s, but expected %s", result, expected)

View file

@ -114,10 +114,6 @@ func unmarshalJSON(data []byte, result interface{}) error {
return nil
}
func deepEqual(expected interface{}, result interface{}) bool {
return reflect.DeepEqual(result, expected)
}
func convertSliceOfStringsToMap(input []string) map[string]struct{} {
output := make(map[string]struct{})
for _, v := range input {