@@ -24,7 +24,7 @@ fn fails_when_in_wrong_dir() {
24
24
fn verify_all_success ( ) {
25
25
Command :: cargo_bin ( "rustlings" )
26
26
. unwrap ( )
27
- . arg ( "v " )
27
+ . arg ( "verify " )
28
28
. current_dir ( "tests/fixture/success" )
29
29
. assert ( )
30
30
. success ( ) ;
@@ -34,7 +34,7 @@ fn verify_all_success() {
34
34
fn verify_fails_if_some_fails ( ) {
35
35
Command :: cargo_bin ( "rustlings" )
36
36
. unwrap ( )
37
- . arg ( "v " )
37
+ . arg ( "verify " )
38
38
. current_dir ( "tests/fixture/failure" )
39
39
. assert ( )
40
40
. code ( 1 ) ;
@@ -44,7 +44,7 @@ fn verify_fails_if_some_fails() {
44
44
fn run_single_compile_success ( ) {
45
45
Command :: cargo_bin ( "rustlings" )
46
46
. unwrap ( )
47
- . args ( & [ "r " , "compSuccess" ] )
47
+ . args ( & [ "run " , "compSuccess" ] )
48
48
. current_dir ( "tests/fixture/success/" )
49
49
. assert ( )
50
50
. success ( ) ;
@@ -54,7 +54,7 @@ fn run_single_compile_success() {
54
54
fn run_single_compile_failure ( ) {
55
55
Command :: cargo_bin ( "rustlings" )
56
56
. unwrap ( )
57
- . args ( & [ "r " , "compFailure" ] )
57
+ . args ( & [ "run " , "compFailure" ] )
58
58
. current_dir ( "tests/fixture/failure/" )
59
59
. assert ( )
60
60
. code ( 1 ) ;
@@ -64,7 +64,7 @@ fn run_single_compile_failure() {
64
64
fn run_single_test_success ( ) {
65
65
Command :: cargo_bin ( "rustlings" )
66
66
. unwrap ( )
67
- . args ( & [ "r " , "testSuccess" ] )
67
+ . args ( & [ "run " , "testSuccess" ] )
68
68
. current_dir ( "tests/fixture/success/" )
69
69
. assert ( )
70
70
. success ( ) ;
@@ -74,7 +74,7 @@ fn run_single_test_success() {
74
74
fn run_single_test_failure ( ) {
75
75
Command :: cargo_bin ( "rustlings" )
76
76
. unwrap ( )
77
- . args ( & [ "r " , "testFailure" ] )
77
+ . args ( & [ "run " , "testFailure" ] )
78
78
. current_dir ( "tests/fixture/failure/" )
79
79
. assert ( )
80
80
. code ( 1 ) ;
@@ -84,7 +84,7 @@ fn run_single_test_failure() {
84
84
fn run_single_test_not_passed ( ) {
85
85
Command :: cargo_bin ( "rustlings" )
86
86
. unwrap ( )
87
- . args ( & [ "r " , "testNotPassed.rs" ] )
87
+ . args ( & [ "run " , "testNotPassed.rs" ] )
88
88
. current_dir ( "tests/fixture/failure/" )
89
89
. assert ( )
90
90
. code ( 1 ) ;
@@ -94,7 +94,7 @@ fn run_single_test_not_passed() {
94
94
fn run_single_test_no_filename ( ) {
95
95
Command :: cargo_bin ( "rustlings" )
96
96
. unwrap ( )
97
- . arg ( "r " )
97
+ . arg ( "run " )
98
98
. current_dir ( "tests/fixture/" )
99
99
. assert ( )
100
100
. code ( 1 ) ;
@@ -104,7 +104,7 @@ fn run_single_test_no_filename() {
104
104
fn run_single_test_no_exercise ( ) {
105
105
Command :: cargo_bin ( "rustlings" )
106
106
. unwrap ( )
107
- . args ( & [ "r " , "compNoExercise.rs" ] )
107
+ . args ( & [ "run " , "compNoExercise.rs" ] )
108
108
. current_dir ( "tests/fixture/failure" )
109
109
. assert ( )
110
110
. code ( 1 ) ;
@@ -114,7 +114,7 @@ fn run_single_test_no_exercise() {
114
114
fn get_hint_for_single_test ( ) {
115
115
Command :: cargo_bin ( "rustlings" )
116
116
. unwrap ( )
117
- . args ( & [ "h " , "testFailure" ] )
117
+ . args ( & [ "hint " , "testFailure" ] )
118
118
. current_dir ( "tests/fixture/failure" )
119
119
. assert ( )
120
120
. code ( 0 )
@@ -131,18 +131,23 @@ fn all_exercises_require_confirmation() {
131
131
file. read_to_string ( & mut s) . unwrap ( ) ;
132
132
s
133
133
} ;
134
- source. matches ( "// I AM NOT DONE" ) . next ( ) . unwrap_or_else ( || panic ! (
135
- "There should be an `I AM NOT DONE` annotation in {:?}" ,
136
- path
137
- ) ) ;
134
+ source
135
+ . matches ( "// I AM NOT DONE" )
136
+ . next ( )
137
+ . unwrap_or_else ( || {
138
+ panic ! (
139
+ "There should be an `I AM NOT DONE` annotation in {:?}" ,
140
+ path
141
+ )
142
+ } ) ;
138
143
}
139
144
}
140
145
141
146
#[ test]
142
147
fn run_compile_exercise_does_not_prompt ( ) {
143
148
Command :: cargo_bin ( "rustlings" )
144
149
. unwrap ( )
145
- . args ( & [ "r " , "pending_exercise" ] )
150
+ . args ( & [ "run " , "pending_exercise" ] )
146
151
. current_dir ( "tests/fixture/state" )
147
152
. assert ( )
148
153
. code ( 0 )
@@ -153,7 +158,7 @@ fn run_compile_exercise_does_not_prompt() {
153
158
fn run_test_exercise_does_not_prompt ( ) {
154
159
Command :: cargo_bin ( "rustlings" )
155
160
. unwrap ( )
156
- . args ( & [ "r " , "pending_test_exercise" ] )
161
+ . args ( & [ "run " , "pending_test_exercise" ] )
157
162
. current_dir ( "tests/fixture/state" )
158
163
. assert ( )
159
164
. code ( 0 )
@@ -164,7 +169,7 @@ fn run_test_exercise_does_not_prompt() {
164
169
fn run_single_test_success_with_output ( ) {
165
170
Command :: cargo_bin ( "rustlings" )
166
171
. unwrap ( )
167
- . args ( & [ "--nocapture" , "r " , "testSuccess" ] )
172
+ . args ( & [ "--nocapture" , "run " , "testSuccess" ] )
168
173
. current_dir ( "tests/fixture/success/" )
169
174
. assert ( )
170
175
. code ( 0 )
@@ -175,7 +180,7 @@ fn run_single_test_success_with_output() {
175
180
fn run_single_test_success_without_output ( ) {
176
181
Command :: cargo_bin ( "rustlings" )
177
182
. unwrap ( )
178
- . args ( & [ "r " , "testSuccess" ] )
183
+ . args ( & [ "run " , "testSuccess" ] )
179
184
. current_dir ( "tests/fixture/success/" )
180
185
. assert ( )
181
186
. code ( 0 )
@@ -192,26 +197,6 @@ fn run_rustlings_list() {
192
197
. success ( ) ;
193
198
}
194
199
195
- #[ test]
196
- fn run_rustlings_list_conflicting_display_options ( ) {
197
- Command :: cargo_bin ( "rustlings" )
198
- . unwrap ( )
199
- . args ( & [ "list" , "--names" , "--paths" ] )
200
- . current_dir ( "tests/fixture/success" )
201
- . assert ( )
202
- . failure ( ) ;
203
- }
204
-
205
- #[ test]
206
- fn run_rustlings_list_conflicting_solve_options ( ) {
207
- Command :: cargo_bin ( "rustlings" )
208
- . unwrap ( )
209
- . args ( & [ "list" , "--solved" , "--unsolved" ] )
210
- . current_dir ( "tests/fixture/success" )
211
- . assert ( )
212
- . failure ( ) ;
213
- }
214
-
215
200
#[ test]
216
201
fn run_rustlings_list_no_pending ( ) {
217
202
Command :: cargo_bin ( "rustlings" )
@@ -231,10 +216,7 @@ fn run_rustlings_list_both_done_and_pending() {
231
216
. current_dir ( "tests/fixture/state" )
232
217
. assert ( )
233
218
. success ( )
234
- . stdout (
235
- predicates:: str:: contains ( "Done" )
236
- . and ( predicates:: str:: contains ( "Pending" ) )
237
- ) ;
219
+ . stdout ( predicates:: str:: contains ( "Done" ) . and ( predicates:: str:: contains ( "Pending" ) ) ) ;
238
220
}
239
221
240
222
#[ test]
@@ -258,4 +240,3 @@ fn run_rustlings_list_without_done() {
258
240
. success ( )
259
241
. stdout ( predicates:: str:: contains ( "Done" ) . not ( ) ) ;
260
242
}
261
-
0 commit comments