Merge pull request #4690 from codeblack08/test-round
Add test for float::round
This commit is contained in:
commit
3e9c95e1f7
@ -581,6 +581,15 @@ pub fn test_to_str_inf() {
|
||||
assert to_str(-infinity, 10u) == ~"-inf";
|
||||
}
|
||||
|
||||
#[test]
|
||||
pub fn test_round() {
|
||||
assert round(5.8) == 6.0;
|
||||
assert round(5.2) == 5.0;
|
||||
assert round(3.0) == 3.0;
|
||||
assert round(2.5) == 3.0;
|
||||
assert round(-3.5) == -4.0;
|
||||
}
|
||||
|
||||
#[test]
|
||||
pub fn test_traits() {
|
||||
fn test<U:num::Num cmp::Eq>(ten: &U) {
|
||||
@ -609,8 +618,3 @@ pub fn test_traits() {
|
||||
// buffer-file-coding-system: utf-8-unix
|
||||
// End:
|
||||
//
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user