rust/src/test/run-pass/import-glob-circular.rs

51 lines
1.0 KiB
Rust
Raw Normal View History

import test1::*;
import test2::*;
mod circ1 {
2011-07-27 07:19:39 -05:00
import circ1::*;
export f1;
export f2;
export common;
fn f1() -> uint { ret 1u }
fn common() -> uint { ret 1u; }
}
mod circ2 {
2011-07-27 07:19:39 -05:00
import circ2::*;
export f1;
export f2;
export common;
fn f2() -> uint { ret 2u; }
fn common() -> uint { ret 2u; }
}
mod test1 {
2011-07-27 07:19:39 -05:00
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 {
2011-07-27 07:19:39 -05:00
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(); }