You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Operands (and, or, bool) work by maintaining a counter of different conditions that must all be met before a subfilter can match.
That counter should only be decremented once per tested condition on any given subfilter.
But when testing an array of values with exists, the exists matcher decrements the counter without verifying if the condition has already been verified.
For instance, the following condition: exists: foo["bar"] matches 2 times if the following object is tested: {"foo": ["bar", "bar"]}
This bug is solved by #26, by making the exists matcher test only a set of unique values extracted from the array.
I checked the other matchers and they seem unaffected by this bug.
And... I also activated notifications on this repository. Sorry for not having see that issue earlier.
If you have an and filter, and one of the sub filters is an exists against a array with duplicate values, the other filters are ignored.
Expected Behavior
The other filters should still be respected.
Current Behavior
It appears the other filters are ignored.
Steps to Reproduce
The following code demonstrates the problem
Note that in the second document
javascript
is duplicated inskills.languages
. If you remove the extrajavascript
item, the test passes as expected.Context (Environment)
I'm using lts/carbon, with koncorde 1.2.1
Problem came across in our internal testing.
The text was updated successfully, but these errors were encountered: