1
Fork 0

test: Fix tests.

This commit is contained in:
Patrick Walton 2013-05-15 14:10:42 -07:00
parent 08e561ae70
commit db518ef68a
20 changed files with 55 additions and 42 deletions

View file

@ -9,13 +9,15 @@
// except according to those terms.
use core::cmp::{Eq, Ord};
use core::num::NumCast::from;
use core::num::NumCast;
pub trait NumExt: Eq + Ord + Num + NumCast {}
impl NumExt for f32 {}
fn num_eq_one<T:NumExt>(n: T) { io::println(fmt!("%?", n == from(1))) }
fn num_eq_one<T:NumExt>(n: T) {
io::println(fmt!("%?", n == NumCast::from(1)))
}
pub fn main() {
num_eq_one(1f32); // you need to actually use the function to trigger the ICE