Skip to content
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

Fix TimeOfDayQuestionResult predicate comparison #1392

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

eschramm
Copy link
Contributor

@eschramm eschramm commented Jul 21, 2020

Fixes #1391. Here, an alternative approach is presented for evaluating a TimeOfDayQuestionResult with the same inputs (minimumExpectedHour, minimumExpectedMinutes, maximumExpectedHour, maximumExpectedMinutes) which only checks the minutes if the hour matches.

To minimize the disruption to the NSPredicate builder, this approach adds a check to see if the incoming subPredicateFormat begins with a parenthesis which would normally create an invalid predicate. If this is encountered, it passes more control to the caller to perform more complex comparisons with the expectation the caller will prefix keys with the required $z..

A test is added to further demonstrate the bug and it's resolution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

TimeOfDayQuestionResult predicates fail if minutes > maximumExpectedMinutes regardless of hour
1 participant