updated test coverage

Signed-off-by: Dave Shanley <dave@quobix.com>
This commit is contained in:
Dave Shanley
2023-07-22 13:39:30 -04:00
committed by quobix
parent 50c1d80563
commit 5cb4939522
2 changed files with 26 additions and 4 deletions

View File

@@ -189,6 +189,17 @@ why:
assert.Len(t, *r.SpecBytes, 55)
}
func TestExtractSpecInfo_AnyDocument_JSON(t *testing.T) {
random := `{ "something" : "yeah"}`
r, e := ExtractSpecInfoWithDocumentCheck([]byte(random), true)
assert.Nil(t, e)
assert.NotNil(t, r.RootNode)
assert.Equal(t, "something", r.RootNode.Content[0].Content[0].Value)
assert.Len(t, *r.SpecBytes, 23)
}
func TestExtractSpecInfo_AnyDocumentFromConfig(t *testing.T) {
random := `something: yeah