Skip to content

Commit

Permalink
Add a test for complex divide by zero.
Browse files Browse the repository at this point in the history
  • Loading branch information
treeman committed Aug 14, 2014
1 parent 9d55421 commit 0f40cf1
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/libnum/complex.rs
Expand Up @@ -257,6 +257,14 @@ mod test {
assert_eq!(_1_0i.inv(), _1_0i.inv());
}

#[test]
#[should_fail]
fn test_divide_by_zero_natural() {
let n = Complex::new(2i, 3i);
let d = Complex::new(0, 0);
let _x = n / d;
}

#[test]
#[should_fail]
#[ignore]
Expand Down

13 comments on commit 0f40cf1

@bors
Copy link
Contributor

@bors bors commented on 0f40cf1 Aug 15, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bors
Copy link
Contributor

@bors bors commented on 0f40cf1 Aug 15, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

merging treeman/rust/complex-divide-by-zero-test = 0f40cf1 into auto

@bors
Copy link
Contributor

@bors bors commented on 0f40cf1 Aug 15, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

treeman/rust/complex-divide-by-zero-test = 0f40cf1 merged ok, testing candidate = d1d5a38b

@bors
Copy link
Contributor

@bors bors commented on 0f40cf1 Aug 15, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bors
Copy link
Contributor

@bors bors commented on 0f40cf1 Aug 15, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

merging treeman/rust/complex-divide-by-zero-test = 0f40cf1 into auto

@bors
Copy link
Contributor

@bors bors commented on 0f40cf1 Aug 15, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

treeman/rust/complex-divide-by-zero-test = 0f40cf1 merged ok, testing candidate = 2f27213f

@bors
Copy link
Contributor

@bors bors commented on 0f40cf1 Aug 16, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bors
Copy link
Contributor

@bors bors commented on 0f40cf1 Aug 16, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

merging treeman/rust/complex-divide-by-zero-test = 0f40cf1 into auto

@bors
Copy link
Contributor

@bors bors commented on 0f40cf1 Aug 16, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

treeman/rust/complex-divide-by-zero-test = 0f40cf1 merged ok, testing candidate = bc181f8

@bors
Copy link
Contributor

@bors bors commented on 0f40cf1 Aug 16, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fast-forwarding master to auto = bc181f8

Please sign in to comment.