mirror of
https://github.com/LukeHagar/libopenapi.git
synced 2025-12-06 04:20:11 +00:00
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.
31 lines
649 B
Go
31 lines
649 B
Go
// 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())
|
|
|
|
}
|