A massive test update to bring everything inlne with the new Buildable signature.

All tests in index and datamodel now pass. The rolodex fixes all the things.

Signed-off-by: quobix <dave@quobix.com>
This commit is contained in:
quobix
2023-10-23 18:18:44 -04:00
parent 8717b3cd33
commit 6e9db7f838
53 changed files with 1194 additions and 1069 deletions

View File

@@ -4,6 +4,7 @@
package base
import (
"context"
"fmt"
lowmodel "github.com/pb33f/libopenapi/datamodel/low"
lowbase "github.com/pb33f/libopenapi/datamodel/low/base"
@@ -29,7 +30,7 @@ x-hack: code`
var lowExample lowbase.Example
_ = lowmodel.BuildModel(cNode.Content[0], &lowExample)
_ = lowExample.Build(&cNode, cNode.Content[0], nil)
_ = lowExample.Build(context.Background(), &cNode, cNode.Content[0], nil)
// build high
highExample := NewExample(&lowExample)
@@ -59,7 +60,7 @@ func TestExtractExamples(t *testing.T) {
var lowExample lowbase.Example
_ = lowmodel.BuildModel(cNode.Content[0], &lowExample)
_ = lowExample.Build(nil, cNode.Content[0], nil)
_ = lowExample.Build(context.Background(), nil, cNode.Content[0], nil)
examplesMap := make(map[lowmodel.KeyReference[string]]lowmodel.ValueReference[*lowbase.Example])
examplesMap[lowmodel.KeyReference[string]{
@@ -89,7 +90,7 @@ x-hack: code`
_ = lowmodel.BuildModel(node.Content[0], &lowExample)
// build out low-level example
_ = lowExample.Build(nil, node.Content[0], nil)
_ = lowExample.Build(context.Background(), nil, node.Content[0], nil)
// create a new high-level example
highExample := NewExample(&lowExample)