Skip to content

Commit

Permalink
cleanup unneccessary test case list; fix variable naming
Browse files Browse the repository at this point in the history
  • Loading branch information
Kirhchoff authored and dhubler committed Feb 13, 2024
1 parent b755b11 commit 4921420
Showing 1 changed file with 6 additions and 11 deletions.
17 changes: 6 additions & 11 deletions node/find_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -166,24 +166,19 @@ func TestFindPathIntoListItemContainer(t *testing.T) {
"fruits=apple/boat",
}
for _, test := range tests {
root := node.NewBrowser(m, nodeutil.ReflectChild(root)).Root()
target, err := root.Find(test)
browser := node.NewBrowser(m, nodeutil.ReflectChild(root)).Root()
target, err := browser.Find(test)
fc.RequireEqual(t, nil, err)
fc.AssertEqual(t, true, target != nil, "Could not find target "+test)
}
}

func TestFindPathInsideEmptyList(t *testing.T) {
m, root := LoadPathTestData()
tests := []string{
"fruits=pear/origin/country",
}
for _, test := range tests {
root := node.NewBrowser(m, nodeutil.ReflectChild(root)).Root()
target, err := root.Find(test)
fc.RequireEqual(t, nil, err)
fc.AssertEqual(t, true, target == nil, "Target should not be found"+test)
}
browser := node.NewBrowser(m, nodeutil.ReflectChild(root)).Root()
target, err := browser.Find("fruits=pear/origin/country")
fc.RequireEqual(t, nil, err)
fc.AssertEqual(t, true, target == nil, "Target should not be found (fruits=pear/origin/country)")
}

func LoadPathTestData() (*meta.Module, map[string]interface{}) {
Expand Down

0 comments on commit 4921420

Please sign in to comment.