]> git.lizzy.rs Git - rust.git/blob - src/test/run-pass/issue-7663.rs
Use `assert_eq!` instead of `assert!` in tests
[rust.git] / src / test / run-pass / issue-7663.rs
1 // Copyright 2014 The Rust Project Developers. See the COPYRIGHT
2 // file at the top-level directory of this distribution and at
3 // http://rust-lang.org/COPYRIGHT.
4 //
5 // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6 // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8 // option. This file may not be copied, modified, or distributed
9 // except according to those terms.
10
11
12 #![allow(unused_imports, dead_code)]
13
14 mod test1 {
15
16     mod foo { pub fn p() -> isize { 1 } }
17     mod bar { pub fn p() -> isize { 2 } }
18
19     pub mod baz {
20         use test1::bar::p;
21
22         pub fn my_main() { assert_eq!(p(), 2); }
23     }
24 }
25
26 mod test2 {
27
28     mod foo { pub fn p() -> isize { 1 } }
29     mod bar { pub fn p() -> isize { 2 } }
30
31     pub mod baz {
32         use test2::bar::p;
33
34         pub fn my_main() { assert_eq!(p(), 2); }
35     }
36 }
37
38 fn main() {
39     test1::baz::my_main();
40     test2::baz::my_main();
41 }