-
-
Notifications
You must be signed in to change notification settings - Fork 5
fix(uptime): have jsonpath asserts compare against values #471
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
fix(uptime): have jsonpath asserts compare against values #471
Conversation
Instead of mapping "some results" -> true. This makes for a much easier experience for users. Also, re-jigger some comparison logic, especially for jsonpath tests, since we'll need to coerce based on what we get back.
| Comparison::LessThan => match self { | ||
| JSONPathOperand::None => false, | ||
| JSONPathOperand::Literal { value } => cmp_lt_json(v, value, gas)?, | ||
|
|
||
| JSONPathOperand::Glob { .. } => false, | ||
| }, | ||
| Comparison::GreaterThan => match self { | ||
| JSONPathOperand::None => false, | ||
| JSONPathOperand::Literal { value } => cmp_gt_json(v, value, gas)?, | ||
|
|
||
| JSONPathOperand::Glob { .. } => false, | ||
| }, | ||
| Comparison::Equal => cmp_eq_jsonpath(v, self, gas)?, | ||
| Comparison::NotEqual => !cmp_eq_jsonpath(v, self, gas)?, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do all of these comparisons have tests that validate them? I didn't see it in the new tests, but wasn't sure if they already existed
| super::JSONPathOperand::Literal { value } => JSONPathOperand::Literal { | ||
| value: value.clone(), | ||
| }, | ||
| super::JSONPathOperand::Glob { pattern: value } => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same question here about whether this has tests
Instead of mapping "some results" -> true. This makes for a much easier experience for users. Also, re-jigger some comparison logic, especially for jsonpath tests, since we'll need to coerce based on what we get back.