mirror of
https://github.com/LukeHagar/libopenapi.git
synced 2025-12-07 04:20:14 +00:00
Added in high document API
filling out documentation, looking at DX and how to consume things, re-shuffling and cleaning house.
This commit is contained in:
@@ -659,3 +659,27 @@ func TestIsNodeRefValue_False(t *testing.T) {
|
||||
assert.Nil(t, node)
|
||||
assert.Empty(t, val)
|
||||
}
|
||||
|
||||
func TestCheckEnumForDuplicates_Success(t *testing.T) {
|
||||
yml := "- yes\n- no\n- crisps"
|
||||
var rootNode yaml.Node
|
||||
yaml.Unmarshal([]byte(yml), &rootNode)
|
||||
assert.Len(t, CheckEnumForDuplicates(rootNode.Content[0].Content), 0)
|
||||
|
||||
}
|
||||
|
||||
func TestCheckEnumForDuplicates_Fail(t *testing.T) {
|
||||
yml := "- yes\n- no\n- crisps\n- no"
|
||||
var rootNode yaml.Node
|
||||
yaml.Unmarshal([]byte(yml), &rootNode)
|
||||
assert.Len(t, CheckEnumForDuplicates(rootNode.Content[0].Content), 1)
|
||||
|
||||
}
|
||||
|
||||
func TestCheckEnumForDuplicates_FailMultiple(t *testing.T) {
|
||||
yml := "- yes\n- no\n- crisps\n- no\n- rice\n- yes\n- no"
|
||||
|
||||
var rootNode yaml.Node
|
||||
yaml.Unmarshal([]byte(yml), &rootNode)
|
||||
assert.Len(t, CheckEnumForDuplicates(rootNode.Content[0].Content), 3)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user