mirror of
https://github.com/LukeHagar/libopenapi.git
synced 2025-12-09 20:47:44 +00:00
chore: Adds a test for resolver.ResolverError.Error()
This commit is contained in:
committed by
Dave Shanley
parent
cd63f66efe
commit
851062b628
@@ -1,6 +1,7 @@
|
|||||||
package resolver
|
package resolver
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
"testing"
|
"testing"
|
||||||
@@ -226,3 +227,18 @@ func ExampleNewResolver() {
|
|||||||
len(circularErrors), len(resolver.GetPolymorphicCircularErrors()), len(resolver.GetNonPolymorphicCircularErrors()))
|
len(circularErrors), len(resolver.GetPolymorphicCircularErrors()), len(resolver.GetNonPolymorphicCircularErrors()))
|
||||||
// Output: There are 3 circular reference errors, 0 of them are polymorphic errors, 3 are not
|
// Output: There are 3 circular reference errors, 0 of them are polymorphic errors, 3 are not
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func ExampleResolvingError() {
|
||||||
|
re := ResolvingError{
|
||||||
|
ErrorRef: errors.New("Je suis une erreur"),
|
||||||
|
Node: &yaml.Node{
|
||||||
|
Line: 5,
|
||||||
|
Column: 21,
|
||||||
|
},
|
||||||
|
Path: "#/definitions/JeSuisUneErreur",
|
||||||
|
CircularReference: &index.CircularReferenceResult{},
|
||||||
|
}
|
||||||
|
|
||||||
|
fmt.Printf("%s", re.Error())
|
||||||
|
// Output: Je suis une erreur: #/definitions/JeSuisUneErreur [5:21]
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user