Skip to content

Commit

Permalink
more ye olde time coverage for ye tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
daveshanley committed Aug 5, 2024
1 parent 126c8e9 commit c03d8b6
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 12 deletions.
10 changes: 1 addition & 9 deletions datamodel/low/base/example.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,15 +89,7 @@ func (ex *Example) Build(ctx context.Context, keyNode, root *yaml.Node, _ *index
expChildNodes := low.ExtractNodesRecursive(ctx, vn)
expChildNodes.Range(func(k, v interface{}) bool {
if arr, ko := v.([]*yaml.Node); ko {
if ext, ok := ex.Nodes.Load(k); ok {
if extArr, kk := ext.([]*yaml.Node); kk {
ex.Nodes.Store(k, append(extArr, arr...))
} else {
ex.Nodes.Store(k, arr)
}
} else {
ex.Nodes.Store(k, arr)
}
ex.Nodes.Store(k, arr)
}
return true
})
Expand Down
3 changes: 0 additions & 3 deletions datamodel/low/base/schema.go
Original file line number Diff line number Diff line change
Expand Up @@ -727,9 +727,6 @@ func (s *Schema) Build(ctx context.Context, root *yaml.Node, idx *index.SpecInde
discriminator.AddNode(key.(int), g)
}
}
if n, ok := val.(*yaml.Node); ok {
discriminator.AddNode(key.(int), n)
}
return true
})
}
Expand Down
6 changes: 6 additions & 0 deletions datamodel/low/v3/server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,12 @@ variables:
low.GenerateHashString(s.Value))

assert.Equal(t, 1, orderedmap.Len(n.GetExtensions()))

// check nodes on variables
for k := n.Variables.Value.First(); k != nil; k = k.Next() {
assert.NotNil(t, k.Value().Value.GetKeyNode())
assert.NotNil(t, k.Value().Value.GetRootNode())
}
}

func TestServer_Build_NoVars(t *testing.T) {
Expand Down

0 comments on commit c03d8b6

Please sign in to comment.