Post migration assertion fixes

Signed-off-by: Daniel Nephin <dnephin@docker.com>

rewritten from github.com/moby/moby c9e52bd0da0461e605a3678b85702f83081504a7
docker-18.09
Daniel Nephin 2017-12-22 16:30:49 -05:00 committed by Tonis Tiigi
parent 3b28b903b9
commit 414a98c2e0
1 changed files with 6 additions and 4 deletions

View File

@ -3,6 +3,7 @@ package parser // import "github.com/docker/docker/builder/dockerfile/parser"
import (
"testing"
"github.com/google/go-cmp/cmp"
"github.com/gotestyourself/gotestyourself/assert"
is "github.com/gotestyourself/gotestyourself/assert/cmp"
)
@ -16,9 +17,11 @@ func TestParseNameValOldFormat(t *testing.T) {
Value: "foo",
Next: &Node{Value: "bar"},
}
assert.Check(t, is.DeepEqual(expected, node))
assert.DeepEqual(t, expected, node, cmpNodeOpt)
}
var cmpNodeOpt = cmp.AllowUnexported(Node{})
func TestParseNameValNewFormat(t *testing.T) {
directive := Directive{}
node, err := parseNameVal("foo=bar thing=star", "LABEL", &directive)
@ -36,7 +39,7 @@ func TestParseNameValNewFormat(t *testing.T) {
},
},
}
assert.Check(t, is.DeepEqual(expected, node))
assert.DeepEqual(t, expected, node, cmpNodeOpt)
}
func TestNodeFromLabels(t *testing.T) {
@ -62,8 +65,7 @@ func TestNodeFromLabels(t *testing.T) {
}
node := NodeFromLabels(labels)
assert.Check(t, is.DeepEqual(expected, node))
assert.DeepEqual(t, expected, node, cmpNodeOpt)
}
func TestParseNameValWithoutVal(t *testing.T) {