Skip to content

Commit 9e1e42d

Browse files
committed
core: Add tests for the string repr of infinity
1 parent 56f0979 commit 9e1e42d

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/libcore/float.rs

+6
Original file line numberDiff line numberDiff line change
@@ -358,6 +358,12 @@ fn test_nonnegative() {
358358
assert(!is_nonnegative(NaN));
359359
}
360360

361+
#[test]
362+
fn test_to_str_inf() {
363+
assert to_str(infinity, 10u) == "inf";
364+
assert to_str(-infinity, 10u) == "-inf";
365+
}
366+
361367
//
362368
// Local Variables:
363369
// mode: rust

0 commit comments

Comments
 (0)