low level base model back at 100% coverage

A few little gaps opened up with new code, all tucked back in.
This commit is contained in:
Dave Shanley
2022-11-04 10:30:12 -04:00
parent a522ec0f91
commit 5e86e7094f
5 changed files with 69 additions and 4 deletions

View File

@@ -24,3 +24,17 @@ func TestSchemaProxy_Build(t *testing.T) {
assert.NotNil(t, sch.GetValueNode())
assert.False(t, sch.IsSchemaReference())
}
func TestSchemaProxy_Build_CheckRef(t *testing.T) {
yml := `$ref: wat`
var sch SchemaProxy
var idxNode yaml.Node
_ = yaml.Unmarshal([]byte(yml), &idxNode)
err := sch.Build(idxNode.Content[0], nil)
assert.NoError(t, err)
assert.True(t, sch.IsSchemaReference())
assert.Equal(t, "wat", sch.GetSchemaReference())
}