File tree 6 files changed +59
-0
lines changed
tests/cargo-fmt/source/issues_6517
6 files changed +59
-0
lines changed Original file line number Diff line number Diff line change @@ -134,4 +134,32 @@ mod all_targets {
134
134
assert_correct_targets_loaded ( "ws/a/d/f/Cargo.toml" ) ;
135
135
}
136
136
}
137
+
138
+ mod cargo_fmt_strategy_root {
139
+ use super :: * ;
140
+
141
+ #[ test]
142
+ fn assert_correct_targets_loaded_from_root ( ) {
143
+ let exp_targets = & [
144
+ ExpTarget {
145
+ path : "inner_bin/src/main.rs" ,
146
+ edition : Edition :: E2021 ,
147
+ kind : "bin" ,
148
+ } ,
149
+ ExpTarget {
150
+ path : "inner_lib/src/lib.rs" ,
151
+ edition : Edition :: E2021 ,
152
+ kind : "lib" ,
153
+ } ,
154
+ ] ;
155
+
156
+ super :: assert_correct_targets_loaded (
157
+ "Cargo.toml" ,
158
+ "issues_6517" ,
159
+ exp_targets,
160
+ 2 ,
161
+ CargoFmtStrategy :: Root ,
162
+ ) ;
163
+ }
164
+ }
137
165
}
Original file line number Diff line number Diff line change
1
+ [workspace ]
2
+ members = [" inner_bin" , " inner_lib" ]
Original file line number Diff line number Diff line change
1
+ [package ]
2
+ name = " inner_bin"
3
+ version = " 0.1.0"
4
+ edition = " 2021"
5
+
6
+ [dependencies ]
Original file line number Diff line number Diff line change
1
+ fn main ( ) {
2
+ println ! ( "Hello, world!" ) ;
3
+ }
Original file line number Diff line number Diff line change
1
+ [package ]
2
+ name = " inner_lib"
3
+ version = " 0.1.0"
4
+ edition = " 2021"
5
+
6
+ [dependencies ]
Original file line number Diff line number Diff line change
1
+ pub fn add ( left : u64 , right : u64 ) -> u64 {
2
+ left + right
3
+ }
4
+
5
+ #[ cfg( test) ]
6
+ mod tests {
7
+ use super :: * ;
8
+
9
+ #[ test]
10
+ fn it_works ( ) {
11
+ let result = add ( 2 , 2 ) ;
12
+ assert_eq ! ( result, 4 ) ;
13
+ }
14
+ }
You can’t perform that action at this time.
0 commit comments