mirror of
https://github.com/LukeHagar/libopenapi.git
synced 2025-12-10 20:47:44 +00:00
fix: continued moving everything to orderedmaps plus cleaned up most the tests
This commit is contained in:
@@ -10,6 +10,7 @@ import (
|
||||
|
||||
"github.com/pb33f/libopenapi/datamodel/low"
|
||||
"github.com/pb33f/libopenapi/index"
|
||||
"github.com/pb33f/libopenapi/orderedmap"
|
||||
"github.com/stretchr/testify/assert"
|
||||
"gopkg.in/yaml.v3"
|
||||
)
|
||||
@@ -100,7 +101,7 @@ func TestComponents_Build_Success(t *testing.T) {
|
||||
assert.Equal(t, "eighteen of many",
|
||||
n.FindCallback("eighteen").Value.FindExpression("{raference}").Value.Post.Value.Description.Value)
|
||||
|
||||
assert.Equal(t, "7add1a6c63a354b1a8ffe22552c213fe26d1229beb0b0cbe7c7ca06e63f9a364",
|
||||
assert.Equal(t, "76328a0e32a9989471d335734af04a37bdfad333cf8cd8aa8065998c3a1489a2",
|
||||
low.GenerateHashString(&n))
|
||||
}
|
||||
|
||||
@@ -223,7 +224,11 @@ headers:
|
||||
|
||||
err = n.Build(context.Background(), idxNode.Content[0], idx)
|
||||
assert.NoError(t, err)
|
||||
assert.Equal(t, "seagull", n.FindExtension("x-curry").Value)
|
||||
|
||||
var xCurry string
|
||||
_ = n.FindExtension("x-curry").Value.Decode(&xCurry)
|
||||
|
||||
assert.Equal(t, "seagull", xCurry)
|
||||
}
|
||||
|
||||
func TestComponents_Build_HashEmpty(t *testing.T) {
|
||||
@@ -240,8 +245,12 @@ func TestComponents_Build_HashEmpty(t *testing.T) {
|
||||
|
||||
err = n.Build(context.Background(), idxNode.Content[0], idx)
|
||||
assert.NoError(t, err)
|
||||
assert.Equal(t, "seagull", n.FindExtension("x-curry").Value)
|
||||
assert.Len(t, n.GetExtensions(), 1)
|
||||
assert.Equal(t, "9cf2c6ab3f9ff7e5231fcb391c8af5c47406711d2ca366533f21a8bb2f67edfe",
|
||||
|
||||
var xCurry string
|
||||
_ = n.FindExtension("x-curry").Value.Decode(&xCurry)
|
||||
|
||||
assert.Equal(t, "seagull", xCurry)
|
||||
assert.Equal(t, 1, orderedmap.Len(n.GetExtensions()))
|
||||
assert.Equal(t, "e45605d7361dbc9d4b9723257701bef1d283f8fe9566b9edda127fc66a6b8fdd",
|
||||
low.GenerateHashString(&n))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user