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

FC-1437: add tests for order-by with limit and offset #200

Merged
merged 6 commits into from
Oct 13, 2022
Merged

Conversation

zonotope
Copy link
Contributor

Tests for the code added in fluree/db#207

@zonotope zonotope requested a review from a team October 13, 2022 14:55
Copy link
Contributor

@cap10morgan cap10morgan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One comment on the tests I'll leave entirely to your judgment, but certainly not a blocker.

(comp (drop offset)
(take limit))
all-results))
"returns subjects only up to the limit after the offset"))))))))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd have slightly more confidence in these tests if the expected values were either hard-coded values or calculated/compared in a much more primitive way (vs. the logic implementation in the code under test).

E.g. for offest=1, limit=1

(is (= 1 (count subject)))
(is (= (first subject) (second all-results)))

Otherwise they could be wrong for the same reason(s) and agree with each other and pass.

Not a huge deal here, so I'll leave it up to you.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah, i definitely had some hesitance about using exactly the same algorithm too. i think i got too clever in the name of test robustness. i'll change it.

@zonotope zonotope merged commit 14467e9 into main Oct 13, 2022
@zonotope zonotope deleted the fix/query-limit branch October 13, 2022 17:14
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.

2 participants