We recently added these docs:
|
/// Construct a [Range] that counts up to the given item. |
|
/// |
|
/// # Panics |
|
/// |
|
/// This function will panic when trying to create a [Range] where the upper bound is less than the lower bound. |
This behavior is tested in this unit test:
|
#[test] |
|
#[should_panic] |
|
fn fail_up_to_invalid_range() { |
|
from(40).up_to(39); |
|
} |
It is also possible for this to become a doc test (as I've just found out), which would make this more visible.
We recently added these docs:
a-range/src/lib.rs
Lines 54 to 58 in ce391ed
This behavior is tested in this unit test:
a-range/src/lib.rs
Lines 393 to 397 in ce391ed
It is also possible for this to become a doc test (as I've just found out), which would make this more visible.
fail_up_to_invalid_rangeandfail_down_to_invalid_rangetests into doc tests