File tree 2 files changed +55
-27
lines changed
2 files changed +55
-27
lines changed Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -170,3 +170,58 @@ pub async fn run_main(args: Vec<String>) -> i32 {
170
170
end_log_group ( ) ;
171
171
0
172
172
}
173
+
174
+ #[ cfg( test) ]
175
+ mod test {
176
+ use super :: run_main;
177
+
178
+ #[ tokio:: test]
179
+ async fn run ( ) {
180
+ assert_eq ! (
181
+ run_main( vec![
182
+ "cpp-linter" . to_string( ) ,
183
+ "-l" . to_string( ) ,
184
+ "false" . to_string( )
185
+ ] )
186
+ . await ,
187
+ 0
188
+ ) ;
189
+ }
190
+
191
+ #[ tokio:: test]
192
+ async fn run_version_command ( ) {
193
+ assert_eq ! (
194
+ run_main( vec![ "cpp-linter" . to_string( ) , "version" . to_string( ) ] ) . await ,
195
+ 0
196
+ ) ;
197
+ }
198
+
199
+ #[ tokio:: test]
200
+ async fn run_force_debug_output ( ) {
201
+ assert_eq ! (
202
+ run_main( vec![
203
+ "cpp-linter" . to_string( ) ,
204
+ "-l" . to_string( ) ,
205
+ "false" . to_string( ) ,
206
+ "-v" . to_string( ) ,
207
+ "debug" . to_string( ) ,
208
+ ] )
209
+ . await ,
210
+ 0
211
+ ) ;
212
+ }
213
+
214
+ #[ tokio:: test]
215
+ async fn run_bad_version_input ( ) {
216
+ assert_eq ! (
217
+ run_main( vec![
218
+ "cpp-linter" . to_string( ) ,
219
+ "-l" . to_string( ) ,
220
+ "false" . to_string( ) ,
221
+ "-V" . to_string( )
222
+ ] )
223
+ . await ,
224
+ 1
225
+ ) ;
226
+ }
227
+ }
You can’t perform that action at this time.
0 commit comments