summary refs log tree commit diff
path: root/src/test/run-pass/import-glob-circular.rs
blob: 4035790b934963aac4c3090f336fbebf00d43b8b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
import test1::*;
import test2::*;

mod circ1 {
    import circ1::*;
    export f1;
    export f2;
    export common;
    fn f1() -> uint { ret 1u }
    fn common() -> uint { ret 1u; }
}

mod circ2 {
    import circ2::*;
    export f1;
    export f2;
    export common;
    fn f2() -> uint { ret 2u; }
    fn common() -> uint { ret 2u; }
}

mod test1 {
    import circ1::*;
    fn test1() {
        assert (f1() == 1u);
        //make sure that cached lookups work...
        assert (f1() == 1u);
        //assert(f2() == 2u);  //TODO: renable when 'reexport' is implemented
        //assert(f2() == 2u);
        assert (common() == 1u);
        assert (common() == 1u);
    }
}

mod test2 {
    import circ2::*;
    fn test2() {
        //assert(f1() == 1u);  //TODO: renable when 'reexport' is implemented
        ////make sure that cached lookups work...
        //assert(f1() == 1u);
        assert (f2() == 2u);
        assert (f2() == 2u);
        assert (common() == 2u);
        assert (common() == 2u);
    }
}



fn main() { test1(); test2(); }