Skip to content

Commit 426f1d0

Browse files
committed
test negative arguments of next_multiple_of
1 parent 4a6d159 commit 426f1d0

1 file changed

Lines changed: 8 additions & 4 deletions

File tree

src/lib.rs

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -199,8 +199,10 @@ pub trait Integer: Sized + Num + PartialOrd + Ord + Eq {
199199
///
200200
/// ~~~
201201
/// # use num_integer::Integer;
202-
/// assert_eq!(16.next_multiple_of(&8), 16);
203-
/// assert_eq!(23.next_multiple_of(&8), 24);
202+
/// assert_eq!(16.next_multiple_of(& 8), 16);
203+
/// assert_eq!(23.next_multiple_of(& 8), 24);
204+
/// assert_eq!(16.next_multiple_of(&-8), 16);
205+
/// assert_eq!(23.next_multiple_of(&-8), 16);
204206
/// ~~~
205207
#[inline]
206208
fn next_multiple_of(&self, other: &Self) -> Self where Self: Clone {
@@ -214,8 +216,10 @@ pub trait Integer: Sized + Num + PartialOrd + Ord + Eq {
214216
///
215217
/// ~~~
216218
/// # use num_integer::Integer;
217-
/// assert_eq!(16.next_multiple_back_of(&8), 16);
218-
/// assert_eq!(23.next_multiple_back_of(&8), 16);
219+
/// assert_eq!(16.next_multiple_back_of(& 8), 16);
220+
/// assert_eq!(23.next_multiple_back_of(& 8), 16);
221+
/// assert_eq!(16.next_multiple_back_of(&-8), 16);
222+
/// assert_eq!(23.next_multiple_back_of(&-8), 24);
219223
/// ~~~
220224
#[inline]
221225
fn next_multiple_back_of(&self, other: &Self) -> Self where Self: Clone {

0 commit comments

Comments
 (0)