Skip to content

Commit 116d8e5

Browse files
committed
add IsFound testcase #7
1 parent 2616d09 commit 116d8e5

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

simpleyaml_test.go

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,3 +174,18 @@ func TestMap(t *testing.T) {
174174
}
175175
}
176176

177+
func TestIsFound(t *testing.T) {
178+
y, err := NewYaml(data)
179+
if err != nil {
180+
t.Fatal("init yaml failed")
181+
}
182+
183+
if !y.Get("name").IsFound() { // name is exists
184+
t.Fatal("found name failed")
185+
}
186+
187+
if y.Get("xx").IsFound() { // xx is not exists
188+
t.Fatal("found xx failed")
189+
}
190+
191+
}

0 commit comments

Comments
 (0)