mirror of
https://github.com/LukeHagar/libopenapi.git
synced 2025-12-07 20:47:45 +00:00
Bumping coverage on low level models after new feature.
Fixed borked test
This commit is contained in:
@@ -53,3 +53,29 @@ x-b33f: princess`
|
||||
assert.Equal(t, "princess", ext.Value)
|
||||
|
||||
}
|
||||
|
||||
func TestExternalDoc_Hash(t *testing.T) {
|
||||
|
||||
left := `url: https://pb33f.io
|
||||
description: the ranch
|
||||
x-b33f: princess`
|
||||
|
||||
right := `url: https://pb33f.io
|
||||
x-b33f: princess
|
||||
description: the ranch`
|
||||
|
||||
var lNode, rNode yaml.Node
|
||||
_ = yaml.Unmarshal([]byte(left), &lNode)
|
||||
_ = yaml.Unmarshal([]byte(right), &rNode)
|
||||
|
||||
// create low level objects
|
||||
var lDoc ExternalDoc
|
||||
var rDoc ExternalDoc
|
||||
_ = low.BuildModel(&lNode, &lDoc)
|
||||
_ = low.BuildModel(&rNode, &rDoc)
|
||||
_ = lDoc.Build(lNode.Content[0], nil)
|
||||
_ = rDoc.Build(rNode.Content[0], nil)
|
||||
|
||||
assert.Equal(t, lDoc.Hash(), rDoc.Hash())
|
||||
assert.Len(t, lDoc.GetExtensions(), 1)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user