Skip to content

Commit

Permalink
Add test for Wrapping<T>
Browse files Browse the repository at this point in the history
  • Loading branch information
michiel-de-muynck committed Apr 16, 2017
1 parent 0d5984e commit e47c971
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/test/run-pass/num-wrapping.rs
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,15 @@ fn test_op_assigns() {
tmp.$op(Wrapping($rhs));
assert_eq!(black_box(tmp), Wrapping($ans));
}

// also test that a &Wrapping<T> right-hand side is possible
{
let mut tmp = Wrapping($initial);
tmp = black_box(tmp);
tmp.$op(&Wrapping($rhs));
assert_eq!(black_box(tmp), Wrapping($ans));
}

// FIXME(30524): Uncomment this test
/*
{
Expand Down

0 comments on commit e47c971

Please sign in to comment.