Commit 0b6e17b
committed
Fix check_eq when comparing values (no json data)
The goal was to compare values out of a json array:
example data:
[
{
"key": "value",
"foo": "bar",
"status": "ASTATUS"
}
]
example test case:
...
"testCases": {
"get_status": {
"path": "/programs/",
"method": "GET",
"description": "GET /programs",
"expect": {
"body": {
"path_eq": {
"[0].status": "MYSTATUS"
}
}
}
}
},
This causes 'check_eq' to compare "ASTATUS" (from the data) with
"MYSTATUS" from the test description. This is what I want.
However the given arguements are not json data, and jq fails to retrieve
its' type and eventually fails to make a valid comparison.
First off all the type determination is expected to fail, which is
hidden with the redirection of stderr.
The actual type-comparisons are extended with all recognized types, and
everything else is just compared as a string.1 parent cfd7691 commit 0b6e17b
1 file changed
+8
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
386 | 386 | | |
387 | 387 | | |
388 | 388 | | |
389 | | - | |
| 389 | + | |
390 | 390 | | |
391 | 391 | | |
392 | 392 | | |
393 | | - | |
| 393 | + | |
394 | 394 | | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
395 | 401 | | |
396 | 402 | | |
397 | 403 | | |
| |||
0 commit comments