mirror of
https://github.com/LukeHagar/libopenapi.git
synced 2025-12-09 04:20:17 +00:00
Merge branch 'main' into Baliedge/PIP-2552-consistent-ordering
This commit is contained in:
@@ -4,6 +4,7 @@
|
||||
package v3
|
||||
|
||||
import (
|
||||
"context"
|
||||
"testing"
|
||||
|
||||
"github.com/pb33f/libopenapi/datamodel/low"
|
||||
@@ -35,7 +36,7 @@ func TestCallback_Build_Success(t *testing.T) {
|
||||
err := low.BuildModel(rootNode.Content[0], &n)
|
||||
assert.NoError(t, err)
|
||||
|
||||
err = n.Build(nil, rootNode.Content[0], nil)
|
||||
err = n.Build(context.Background(), nil, rootNode.Content[0], nil)
|
||||
assert.NoError(t, err)
|
||||
|
||||
assert.Equal(t, 1, orderedmap.Len(n.Expression.Value))
|
||||
@@ -67,7 +68,7 @@ func TestCallback_Build_Error(t *testing.T) {
|
||||
err := low.BuildModel(rootNode.Content[0], &n)
|
||||
assert.NoError(t, err)
|
||||
|
||||
err = n.Build(nil, rootNode.Content[0], idx)
|
||||
err = n.Build(context.Background(), nil, rootNode.Content[0], idx)
|
||||
assert.Error(t, err)
|
||||
|
||||
}
|
||||
@@ -102,7 +103,7 @@ func TestCallback_Build_Using_InlineRef(t *testing.T) {
|
||||
err := low.BuildModel(rootNode.Content[0], &n)
|
||||
assert.NoError(t, err)
|
||||
|
||||
err = n.Build(nil, rootNode.Content[0], idx)
|
||||
err = n.Build(context.Background(), nil, rootNode.Content[0], idx)
|
||||
assert.NoError(t, err)
|
||||
assert.Equal(t, 1, orderedmap.Len(n.Expression.Value))
|
||||
|
||||
@@ -130,7 +131,7 @@ x-weed: loved`
|
||||
|
||||
var n Callback
|
||||
_ = low.BuildModel(idxNode.Content[0], &n)
|
||||
_ = n.Build(nil, idxNode.Content[0], idx)
|
||||
_ = n.Build(context.Background(), nil, idxNode.Content[0], idx)
|
||||
|
||||
yml2 := `burgers:
|
||||
description: tasty!
|
||||
@@ -147,7 +148,7 @@ beer:
|
||||
|
||||
var n2 Callback
|
||||
_ = low.BuildModel(idxNode2.Content[0], &n2)
|
||||
_ = n2.Build(nil, idxNode2.Content[0], idx2)
|
||||
_ = n2.Build(context.Background(), nil, idxNode2.Content[0], idx2)
|
||||
|
||||
// hash
|
||||
assert.Equal(t, n.Hash(), n2.Hash())
|
||||
|
||||
Reference in New Issue
Block a user