More thorough testing of BTreeMap::range#67758
More thorough testing of BTreeMap::range#67758bors merged 1 commit intorust-lang:masterfrom ssomers:testing_range
Conversation
|
(rust_highfive has picked a reviewer for you, use r? to override) |
|
src/liballoc/collections/btree/map.rs line 1955 is currently the start of loop of the |
|
It was bound to happen... I had another look and added a test case to cover everything. Note I also let |
|
|
||
| #[test] | ||
| fn test_range_large() { | ||
| let size = 200; |
There was a problem hiding this comment.
Did you try running this in Miri? I think it'll be too slow, and it's probably best to disable this test in Miri (or maybe use a smaller size in Miri, one that doesn't take forever).
There was a problem hiding this comment.
Yes, I always ask Miri. In fact I was relying on Miri a bit too much lately.
It's not a new test, but renamed from _internal _inclusive, and it was bigger before.
There was a problem hiding this comment.
Ah, seems like Miri is fast enough then, great. :)
In fact I was relying on Miri a bit too much lately.
How that?
There was a problem hiding this comment.
Well, not Miri itself, actually. Just the fact that I have Miri set up to run only the src/liballoc tests and forget all the rest on Linux.
There was a problem hiding this comment.
Ah, seems like Miri is fast enough then, great. :)
It was dragging through the test at 500, but I really don't see the point in testing something with 500 elements when 144 would give you the same 3-level search. More? Why - to have a filled up node somewhere? Then 150 would be enough. For starters, I wish we could check a tree's height and/or read that node.CAPACITY or node.B value.
|
@bors r+ Seems fine to add more tests to BTreeMap, since this essentially just checks current behavior rather than changing it. |
|
📌 Commit 8314b7f has been approved by |
More thorough testing of BTreeMap::range Test more of the paths in the `range_search` function in map.rs
|
☀️ Test successful - checks-azure |
Test more of the paths in the
range_searchfunction in map.rs