lib.rs 872 Bytes
Newer Older
1
extern crate mu;
qinsoon's avatar
qinsoon committed
2
#[macro_use]
3
extern crate log;
qinsoon's avatar
qinsoon committed
4 5
#[macro_use]
extern crate maplit;
6

7 8 9
#[macro_use]
mod ir_macros;

10
mod test_ir;
qinsoon's avatar
qinsoon committed
11
mod test_compiler;
12
mod test_runtime;
13
mod test_api;
qinsoon's avatar
qinsoon committed
14

qinsoon's avatar
qinsoon committed
15 16
mod common {
    use std::fmt;
17 18

    #[allow(dead_code)]
19
    pub fn assert_vector_ordered <T: fmt::Debug> (left: &Vec<T>, right: &Vec<T>) {
qinsoon's avatar
qinsoon committed
20 21
        assert_debug_str(left, right);
    }
22 23

    #[allow(dead_code)]
24 25 26 27 28 29 30 31
    pub fn assert_vector_no_order <T: Ord + fmt::Debug + Clone> (left: &Vec<T>, right: &Vec<T>) {
        let mut left_clone = left.clone();
        left_clone.sort();
        let mut right_clone = right.clone();
        right_clone.sort();
        
        assert_debug_str(left_clone, right_clone);
    }
32 33

    #[allow(dead_code)]
qinsoon's avatar
qinsoon committed
34 35
    pub fn assert_debug_str<T: fmt::Debug, U: fmt::Debug> (left: T, right: U) {
        assert_eq!(format!("{:?}", left), format!("{:?}", right))
qinsoon's avatar
qinsoon committed
36
    }
37
}