File tree 4 files changed +23
-22
lines changed
merging_crates_test_reversed
4 files changed +23
-22
lines changed Original file line number Diff line number Diff line change @@ -45,6 +45,5 @@ rust_test(
45
45
srcs = ["rust_project_json_test.rs" ],
46
46
data = [":rust-project.json" ],
47
47
edition = "2018" ,
48
- use_libtest_harness = False ,
49
48
deps = ["//tools/runfiles" ],
50
49
)
Original file line number Diff line number Diff line change 1
- use runfiles:: Runfiles ;
1
+ #[ cfg( test) ]
2
+ mod tests {
3
+ use runfiles:: Runfiles ;
2
4
3
- fn main ( ) {
4
- let r = Runfiles :: create ( ) . unwrap ( ) ;
5
- let rust_project_path =
6
- r. rlocation ( "rules_rust/test/rust_analyzer/aspect_traversal_test/rust-project.json" ) ;
5
+ #[ test]
6
+ fn test_aspect_traverses_all_the_right_corners_of_target_graph ( ) {
7
+ let r = Runfiles :: create ( ) . unwrap ( ) ;
8
+ let rust_project_path =
9
+ r. rlocation ( "rules_rust/test/rust_analyzer/aspect_traversal_test/rust-project.json" ) ;
7
10
8
- let content = std:: fs:: read_to_string ( & rust_project_path)
9
- . expect ( & format ! ( "couldn't open {:?}" , & rust_project_path) ) ;
11
+ let content = std:: fs:: read_to_string ( & rust_project_path)
12
+ . expect ( & format ! ( "couldn't open {:?}" , & rust_project_path) ) ;
10
13
11
- for dep in & [
12
- "lib_dep" ,
13
- "extra_test_dep" ,
14
- "proc_macro_dep" ,
15
- "extra_proc_macro_dep" ,
16
- ] {
17
- if !content. contains ( dep) {
18
- panic ! ( "expected rust-project.json to contain {}." , dep) ;
14
+ for dep in & [
15
+ "lib_dep" ,
16
+ "extra_test_dep" ,
17
+ "proc_macro_dep" ,
18
+ "extra_proc_macro_dep" ,
19
+ ] {
20
+ assert ! (
21
+ content. contains( dep) ,
22
+ "expected rust-project.json to contain {}." ,
23
+ dep
24
+ ) ;
19
25
}
20
26
}
21
27
}
Original file line number Diff line number Diff line change 1
- use runfiles:: Runfiles ;
2
-
3
1
#[ cfg( test) ]
4
2
mod tests {
5
- use super :: * ;
3
+ use runfiles :: Runfiles ;
6
4
7
5
#[ test]
8
6
fn test_deps_of_crate_and_its_test_are_merged ( ) {
Original file line number Diff line number Diff line change 1
- use runfiles:: Runfiles ;
2
-
3
1
#[ cfg( test) ]
4
2
mod tests {
5
- use super :: * ;
3
+ use runfiles :: Runfiles ;
6
4
7
5
#[ test]
8
6
fn test_deps_of_crate_and_its_test_are_merged ( ) {
You can’t perform that action at this time.
0 commit comments