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

Add tests for overlaps operator with DateTimes of varying precision. #36

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

evan-gordon
Copy link
Contributor

Related to #24 but adds cases for DateTimes of varying precisions.

  1. Left might start during Right
  2. Left might end during Right
  3. Left might start and/or end during Right
  4. Right might start during Left but definitely ends during Left
  5. Right might end during Left but definitely starts during Left

These cases can a bit challenging to think through. For reference, I implemented them in the google engine in google/cql#55

The important thing I ran into while implementing this overload was that there are cases added here where most interval checks can't be performed but one case definitely returns true. In order to accomplish this we checked the intervals for the following 4 cases:

1: left ends during right
2: left starts during right
3: right starts during left
4: right ends during left

If any returned true, the result is true, if any checks returned null then the result was null, otherwise false.

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.

1 participant