Added of by one check and test

Signed-off-by: quobix <dave@quobix.com>
This commit is contained in:
quobix
2024-01-17 13:22:23 -05:00
parent 2bc6e9f028
commit 62ed25052a
2 changed files with 14 additions and 0 deletions

View File

@@ -386,6 +386,17 @@ func TestFindKeyNodeFull(t *testing.T) {
assert.Equal(t, "paste", e.Value)
}
func TestFindKeyNodeFull_NoValue(t *testing.T) {
a := &yaml.Node{
Value: "openapi",
}
c, d, e := FindKeyNodeFull("openapi", []*yaml.Node{a})
assert.Equal(t, "openapi", c.Value)
assert.Equal(t, "openapi", d.Value)
assert.Equal(t, "openapi", e.Value)
}
func TestFindKeyNodeFull_MapValueIsLastNode(t *testing.T) {
f := &yaml.Node{
Value: "cheese",