Closed pickx closed 1 year ago
This looks great, thanks a lot for the contribution.
#[cfg(feature = "step_trait")]
#[test]
fn forward_out_of_range() {
// In range
assert_eq!(Some(u7::new(121)), Step::forward_checked(u7::new(120), 1));
assert_eq!(Some(u7::new(127)), Step::forward_checked(u7::new(120), 7));
// Out of range
assert_eq!(None, Step::forward_checked(u7::new(120), 8));
// Out of range for the underlying type
assert_eq!(None, Step::forward_checked(u7::new(120), 140));
}
#[cfg(feature = "step_trait")]
#[test]
fn backward_out_of_range() {
// In range
assert_eq!(Some(u7::new(1)), Step::backward_checked(u7::new(10), 9));
assert_eq!(Some(u7::new(0)), Step::backward_checked(u7::new(10), 10));
// Out of range
assert_eq!(None, Step::backward_checked(u7::new(10), 11));
}
In .github/workflows, make a copy of test-const.yml and swap out the feature.
Once that is added and uploaded, Github should automatically run the test suite with this feature enabled.
Oh! And:
thanks for the guidance! please let me know if there's anything else I'm missing
Thanks a lot for your contribution!
Closes #29.