mirror of
https://github.com/LukeHagar/libopenapi.git
synced 2025-12-09 12:37:49 +00:00
chore: add more test coverage
This commit is contained in:
@@ -5,6 +5,7 @@ import (
|
||||
"testing"
|
||||
|
||||
"github.com/pb33f/libopenapi/orderedmap"
|
||||
"github.com/pb33f/libopenapi/utils"
|
||||
"github.com/stretchr/testify/assert"
|
||||
"gopkg.in/yaml.v3"
|
||||
)
|
||||
@@ -407,3 +408,17 @@ func TestBuildModelAsync(t *testing.T) {
|
||||
wg.Wait()
|
||||
assert.Equal(t, 3, orderedmap.Len(ins.Thing.Value))
|
||||
}
|
||||
|
||||
func TestSetField_NilValueNode(t *testing.T) {
|
||||
assert.NotPanics(t, func() {
|
||||
SetField(nil, nil, nil)
|
||||
})
|
||||
}
|
||||
|
||||
func TestBuildModelAsync_HandlesError(t *testing.T) {
|
||||
errs := []error{}
|
||||
wg := sync.WaitGroup{}
|
||||
wg.Add(1)
|
||||
BuildModelAsync(utils.CreateStringNode("cake"), "cake", &wg, &errs)
|
||||
assert.NotEmpty(t, errs)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user