GitLab will be upgraded on June 2nd 2020 at 2.00 pm (AEDT) to 3.00 pm (AEDT) due to Critical Security Patch Availability. During the update, GitLab and Mattermost services will not be available. If you have any concerns with this, please talk to local Gitlab admin team.

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

8 9 10
#[macro_use]
mod ir_macros;

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

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

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

    #[allow(dead_code)]
25 26 27 28 29 30 31 32
    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);
    }
33 34

    #[allow(dead_code)]
qinsoon's avatar
qinsoon committed
35 36
    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
37
    }
38
}