Add test for float::round

This commit is contained in:
Cody Schroeder 2013-01-30 01:27:08 -08:00
parent 02e907b648
commit b505504dc4

View File

@ -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:
//