提交 75bda422 编写于 作者: D David Rajchenbach-Teller

[Tests] added float tests

上级 8c9dd54d
use std;
import std::float;
#[test]
fn test_from_str() {
assert ( float::from_str("3.14") == 3.14 );
assert ( float::from_str("+3.14") == 3.14 );
assert ( float::from_str("-3.14") == -3.14 );
assert ( float::from_str("2.5E10") == 25000000000. );
assert ( float::from_str("2.5e10") == 25000000000. );
assert ( float::from_str("25000000000.E-10") == 2.5 );
assert ( float::from_str("") == 0. );
assert ( float::from_str(" ") == 0. );
assert ( float::from_str(".") == 0. );
assert ( float::from_str("5.") == 5. );
assert ( float::from_str(".5") == 0.5 );
assert ( float::from_str("0.5") == 0.5 );
}
......@@ -29,6 +29,7 @@ mod sys;
mod task;
mod test;
mod uint;
mod float;
// Local Variables:
// mode: rust
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册