JSON match by value matches only a factor of the value
In the examples given in json.should, we can see that with JSON we don't need to have an identical value to pass the test. For instance rth
matches one value, so the test passes, even if there is no value that is equals to rth
.
I understand the point as should
is based on matching. However this is a bit counter-intuitive regarding value matching in the JSON output, where one would expect an identity. This is especially the case for integer matching. Still in json.should, this test:
j:numbers:12
would also pass with j:numbers:2
as 2
matches the numbers, even though there is no number 2.
I know that I can use a regex to match the whole value (eg. rj:numbers:^2$
to check if a value is 2) but this is not my point.