2011-05-25 12:10:30 -05:00
|
|
|
import test1::*;
|
|
|
|
import test2::*;
|
|
|
|
|
|
|
|
mod circ1 {
|
|
|
|
import circ1::*;
|
2011-05-31 20:24:06 -05:00
|
|
|
export f1;
|
|
|
|
export f2;
|
|
|
|
export common;
|
2011-05-26 19:33:33 -05:00
|
|
|
fn f1() -> uint {
|
|
|
|
ret 1u
|
2011-05-25 12:10:30 -05:00
|
|
|
}
|
|
|
|
fn common() -> uint {
|
2011-05-26 19:33:33 -05:00
|
|
|
ret 1u;
|
2011-05-25 12:10:30 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
mod circ2 {
|
|
|
|
import circ2::*;
|
2011-05-31 20:24:06 -05:00
|
|
|
export f1;
|
|
|
|
export f2;
|
|
|
|
export common;
|
2011-05-26 19:33:33 -05:00
|
|
|
fn f2() -> uint {
|
|
|
|
ret 2u;
|
2011-05-25 12:10:30 -05:00
|
|
|
}
|
|
|
|
fn common() -> uint {
|
2011-05-26 19:33:33 -05:00
|
|
|
ret 2u;
|
2011-05-25 12:10:30 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
mod test1 {
|
|
|
|
import circ1::*;
|
|
|
|
fn test1() {
|
2011-05-26 19:33:33 -05:00
|
|
|
assert(f1() == 1u);
|
|
|
|
//make sure that cached lookups work...
|
|
|
|
assert(f1() == 1u);
|
2011-06-22 17:41:39 -05:00
|
|
|
//assert(f2() == 2u); //TODO: renable when 'reexport' is implemented
|
|
|
|
//assert(f2() == 2u);
|
2011-05-26 19:33:33 -05:00
|
|
|
assert(common() == 1u);
|
|
|
|
assert(common() == 1u);
|
2011-05-25 12:10:30 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
mod test2 {
|
|
|
|
import circ2::*;
|
|
|
|
fn test2() {
|
2011-06-22 17:41:39 -05:00
|
|
|
//assert(f1() == 1u); //TODO: renable when 'reexport' is implemented
|
|
|
|
////make sure that cached lookups work...
|
|
|
|
//assert(f1() == 1u);
|
2011-05-26 19:33:33 -05:00
|
|
|
assert(f2() == 2u);
|
|
|
|
assert(f2() == 2u);
|
2011-07-13 17:44:09 -05:00
|
|
|
assert(common() == 2u);
|
2011-05-26 19:33:33 -05:00
|
|
|
assert(common() == 2u);
|
2011-05-25 12:10:30 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
test1();
|
|
|
|
test2();
|
|
|
|
}
|