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

Make testing use numbers with a step #2

Merged
merged 1 commit into from Jul 24, 2021
Merged

Conversation

RReverser
Copy link
Contributor

Instead of using completely random floating numbers, use stepped ones as this helps catch some interesting edge cases when those numbers start overlap.

E.g. with this change getting right away:

---- tests::test_nearests stdout ----
thread 'tests::test_nearests' panicked at 'assertion failed: `(left == right)`
  left: `8`,
 right: `5`', src\tests.rs:35:9
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

(fixes are not included in this PR)

Instead of using completely random floating numbers, use stepped ones as this helps catch some interesting edge cases when those numbers start overlap.

E.g. with this change getting right away:
```
---- tests::test_nearests stdout ----
thread 'tests::test_nearests' panicked at 'assertion failed: `(left == right)`
  left: `8`,
 right: `5`', src\tests.rs:35:9
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
```

(fixes are not included in this PR)
@u1roh
Copy link
Owner

u1roh commented Jun 7, 2021

@RReverser
Ah, it's a bug of test_nearests(). KdTree::nearests() itself works correctly.
Thank you for your report!
I'll fix the test.

@u1roh u1roh mentioned this pull request Jul 24, 2021
@u1roh u1roh merged commit 46a6eee into u1roh:main Jul 24, 2021
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.

None yet

2 participants