(t *testing.T)
| 199 | } |
| 200 | |
| 201 | func TestJSONInput(t *testing.T) { |
| 202 | var pointsJSON = []byte(`[ |
| 203 | {"id": "i1", "x":4, "y":-5}, |
| 204 | {"id": "i2", "x":-2, "y":-5, "z":1}, |
| 205 | {"id": "i3", "x": 8, "y": 3 }, |
| 206 | {"id": "i4", "x": -6, "y": -1 }, |
| 207 | {"id": "i5", "x": 0, "y": 2, "z": 1 }, |
| 208 | {"id": "i6", "x": 1, "y": 4 } |
| 209 | ]`) |
| 210 | var pointsData interface{} |
| 211 | err := json.Unmarshal(pointsJSON, &pointsData) |
| 212 | if err != nil { |
| 213 | t.Error(err) |
| 214 | } |
| 215 | pointsTests := []jsonpathTest{ |
| 216 | {"exists filter", "{[?(@.z)].id}", pointsData, "i2 i5", false}, |
| 217 | {"bracket key", "{[0]['id']}", pointsData, "i1", false}, |
| 218 | } |
| 219 | testJSONPath(pointsTests, false, t) |
| 220 | } |
| 221 | |
| 222 | // TestKubernetes tests some use cases from kubernetes |
| 223 | func TestKubernetes(t *testing.T) { |
nothing calls this directly
no test coverage detected