mirror of
https://github.com/LukeHagar/libopenapi.git
synced 2025-12-06 12:37:49 +00:00
@@ -13,6 +13,7 @@ import (
|
||||
"os"
|
||||
"os/exec"
|
||||
"path/filepath"
|
||||
"runtime"
|
||||
"strings"
|
||||
"testing"
|
||||
)
|
||||
@@ -80,7 +81,11 @@ func TestBundleDocument_Circular(t *testing.T) {
|
||||
|
||||
bytes, e := BundleDocument(&v3Doc.Model)
|
||||
assert.NoError(t, e)
|
||||
assert.Len(t, *doc.GetSpecInfo().SpecBytes, 1563)
|
||||
if runtime.GOOS != "windows" {
|
||||
assert.Len(t, *doc.GetSpecInfo().SpecBytes, 1563)
|
||||
} else {
|
||||
assert.Len(t, *doc.GetSpecInfo().SpecBytes, 1637)
|
||||
}
|
||||
assert.Len(t, bytes, 2016)
|
||||
|
||||
logEntries := strings.Split(byteBuf.String(), "\n")
|
||||
|
||||
@@ -36,6 +36,19 @@ paths:
|
||||
assert.Equal(t, 2, idx.descriptionCount)
|
||||
}
|
||||
|
||||
func TestSpecIndex_ExtractRefs_CheckSummarySummary(t *testing.T) {
|
||||
yml := `things:
|
||||
summary:
|
||||
summary:
|
||||
- summary`
|
||||
var rootNode yaml.Node
|
||||
_ = yaml.Unmarshal([]byte(yml), &rootNode)
|
||||
c := CreateOpenAPIIndexConfig()
|
||||
idx := NewSpecIndexWithConfig(&rootNode, c)
|
||||
assert.Len(t, idx.allSummaries, 3)
|
||||
assert.Equal(t, 3, idx.summaryCount)
|
||||
}
|
||||
|
||||
func TestSpecIndex_ExtractRefs_CheckPropertiesForInlineSchema(t *testing.T) {
|
||||
yml := `openapi: 3.1.0
|
||||
servers:
|
||||
|
||||
Reference in New Issue
Block a user