mirror of
https://github.com/LukeHagar/libopenapi.git
synced 2025-12-09 20:47:44 +00:00
Large refactor and addedGetAllChanges to each change
tons of updates, so many things.
This commit is contained in:
@@ -1468,6 +1468,31 @@ func TestSchema_Hash_AdditionalPropsSlice(t *testing.T) {
|
||||
assert.Equal(t, lHash, rHash)
|
||||
}
|
||||
|
||||
func TestSchema_Hash_AdditionalPropsSliceNoMap(t *testing.T) {
|
||||
left := `schema:
|
||||
additionalProperties:
|
||||
- hello`
|
||||
|
||||
right := `schema:
|
||||
additionalProperties:
|
||||
- hello`
|
||||
|
||||
var lNode, rNode yaml.Node
|
||||
_ = yaml.Unmarshal([]byte(left), &lNode)
|
||||
_ = yaml.Unmarshal([]byte(right), &rNode)
|
||||
|
||||
lDoc, _ := ExtractSchema(lNode.Content[0], nil)
|
||||
rDoc, _ := ExtractSchema(rNode.Content[0], nil)
|
||||
|
||||
assert.NotNil(t, lDoc)
|
||||
assert.NotNil(t, rDoc)
|
||||
|
||||
lHash := lDoc.Value.Schema().Hash()
|
||||
rHash := rDoc.Value.Schema().Hash()
|
||||
|
||||
assert.Equal(t, lHash, rHash)
|
||||
}
|
||||
|
||||
func TestSchema_Hash_NotEqual(t *testing.T) {
|
||||
left := `schema:
|
||||
title: an OK message - but different
|
||||
|
||||
Reference in New Issue
Block a user