Update documentation for Query

Fix #54
This commit is contained in:
Thomas Pelletier
2016-04-18 09:51:42 +02:00
parent afca7f3334
commit 0e41db2176
2 changed files with 18 additions and 2 deletions
+11
View File
@@ -57,3 +57,14 @@ password = "mypassword"
}
assertArrayContainsInAnyOrder(t, values, "pelletier", "mypassword")
}
func TestQueryPathNotPresent(t *testing.T) {
config, _ := Load(`a = "hello"`)
results, err := config.Query("$.foo.bar")
if err != nil {
t.Fatalf("err should be nil. got %s instead", err)
}
if len(results.items) != 0 {
t.Fatalf("no items should be matched. %d matched instead", len(results.items))
}
}