mirror of
https://github.com/LukeHagar/libopenapi.git
synced 2025-12-06 12:37:49 +00:00
99.9 % coverage & full OpenAPI v3 support
A single line that tries to read an HTTP response body and fails is very hard to test without mocking, and the mock does not add value to a single line of code to check for an error that can rarely ever be triggered. Going to settle for 99.9% for now.
This commit is contained in:
30
index/circular_reference_result_test.go
Normal file
30
index/circular_reference_result_test.go
Normal file
@@ -0,0 +1,30 @@
|
||||
// Copyright 2022 Princess B33f Heavy Industries / Dave Shanley
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
package index
|
||||
|
||||
import (
|
||||
"github.com/stretchr/testify/assert"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestCircularReferenceResult_GenerateJourneyPath(t *testing.T) {
|
||||
|
||||
refs := []*Reference{
|
||||
{Name: "chicken"},
|
||||
{Name: "nuggets"},
|
||||
{Name: "chicken"},
|
||||
{Name: "soup"},
|
||||
{Name: "chicken"},
|
||||
{Name: "nuggets"},
|
||||
{Name: "for"},
|
||||
{Name: "me"},
|
||||
{Name: "and"},
|
||||
{Name: "you"},
|
||||
}
|
||||
|
||||
cr := &CircularReferenceResult{Journey: refs}
|
||||
assert.Equal(t, "chicken -> nuggets -> chicken -> soup -> "+
|
||||
"chicken -> nuggets -> for -> me -> and -> you", cr.GenerateJourneyPath())
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user