Docker-DCO-1.1-Signed-off-by: Jessica Frazelle <jess@docker.com> (github: jfrazelle)
| ... | ... |
@@ -9,6 +9,7 @@ import ( |
| 9 | 9 |
"os/exec" |
| 10 | 10 |
"path" |
| 11 | 11 |
"path/filepath" |
| 12 |
+ "reflect" |
|
| 12 | 13 |
"regexp" |
| 13 | 14 |
"strings" |
| 14 | 15 |
"syscall" |
| ... | ... |
@@ -1569,7 +1570,7 @@ func TestBuildWithVolumes(t *testing.T) {
|
| 1569 | 1569 |
t.Fatal(err) |
| 1570 | 1570 |
} |
| 1571 | 1571 |
|
| 1572 |
- equal := deepEqual(&expected, &result) |
|
| 1572 |
+ equal := reflect.DeepEqual(&result, &expected) |
|
| 1573 | 1573 |
|
| 1574 | 1574 |
if !equal {
|
| 1575 | 1575 |
t.Fatalf("Volumes %s, expected %s", result, expected)
|
| ... | ... |
@@ -4,6 +4,7 @@ import ( |
| 4 | 4 |
"io/ioutil" |
| 5 | 5 |
"os" |
| 6 | 6 |
"os/exec" |
| 7 |
+ "reflect" |
|
| 7 | 8 |
"strings" |
| 8 | 9 |
"testing" |
| 9 | 10 |
"time" |
| ... | ... |
@@ -121,7 +122,7 @@ func TestLinksInspectLinksStarted(t *testing.T) {
|
| 121 | 121 |
|
| 122 | 122 |
output := convertSliceOfStringsToMap(result) |
| 123 | 123 |
|
| 124 |
- equal := deepEqual(expected, output) |
|
| 124 |
+ equal := reflect.DeepEqual(output, expected) |
|
| 125 | 125 |
|
| 126 | 126 |
if !equal {
|
| 127 | 127 |
t.Fatalf("Links %s, expected %s", result, expected)
|
| ... | ... |
@@ -150,7 +151,7 @@ func TestLinksInspectLinksStopped(t *testing.T) {
|
| 150 | 150 |
|
| 151 | 151 |
output := convertSliceOfStringsToMap(result) |
| 152 | 152 |
|
| 153 |
- equal := deepEqual(expected, output) |
|
| 153 |
+ equal := reflect.DeepEqual(output, expected) |
|
| 154 | 154 |
|
| 155 | 155 |
if !equal {
|
| 156 | 156 |
t.Fatalf("Links %s, but expected %s", result, expected)
|
| ... | ... |
@@ -114,10 +114,6 @@ func unmarshalJSON(data []byte, result interface{}) error {
|
| 114 | 114 |
return nil |
| 115 | 115 |
} |
| 116 | 116 |
|
| 117 |
-func deepEqual(expected interface{}, result interface{}) bool {
|
|
| 118 |
- return reflect.DeepEqual(result, expected) |
|
| 119 |
-} |
|
| 120 |
- |
|
| 121 | 117 |
func convertSliceOfStringsToMap(input []string) map[string]struct{} {
|
| 122 | 118 |
output := make(map[string]struct{})
|
| 123 | 119 |
for _, v := range input {
|