@@ -27,12 +27,9 @@ fn init_from_pdu_results() -> Result<()> {
2727fn simple_user_journey_read_only ( ) -> Result < ( ) > {
2828 let long_root = "sample-02/dir" ;
2929 let short_root = "sample-01" ;
30- let ( mut terminal, mut app, traversal_events ) =
30+ let ( mut terminal, mut app) =
3131 initialized_app_and_terminal_from_fixture ( & [ short_root, long_root] ) ?;
32-
33- // TODO: process traversal events before continuing?
34- // let (key_send, key_receive) = crossbeam::channel::bounded(0);
35-
32+
3633 // POST-INIT
3734 // after initialization, we expect that...
3835 {
@@ -70,28 +67,28 @@ fn simple_user_journey_read_only() -> Result<()> {
7067 // SORTING
7168 {
7269 // when hitting the M key
73- app. process_events ( & mut terminal, into_codes ( "m" ) , traversal_events ) ?;
70+ app. process_events ( & mut terminal, into_codes ( "m" ) ) ?;
7471 assert_eq ! (
7572 app. state. sorting,
7673 SortMode :: MTimeDescending ,
7774 "it sets the sort mode to descending by mtime"
7875 ) ;
7976 // when hitting the M key again
80- app. process_events ( & mut terminal, into_codes ( "m" ) , traversal_events ) ?;
77+ app. process_events ( & mut terminal, into_codes ( "m" ) ) ?;
8178 assert_eq ! (
8279 app. state. sorting,
8380 SortMode :: MTimeAscending ,
8481 "it sets the sort mode to ascending by mtime"
8582 ) ;
8683 // when hitting the C key
87- app. process_events ( & mut terminal, into_codes ( "c" ) , traversal_events ) ?;
84+ app. process_events ( & mut terminal, into_codes ( "c" ) ) ?;
8885 assert_eq ! (
8986 app. state. sorting,
9087 SortMode :: CountDescending ,
9188 "it sets the sort mode to descending by count"
9289 ) ;
9390 // when hitting the C key again
94- app. process_events ( & mut terminal, into_codes ( "c" ) , traversal_events ) ?;
91+ app. process_events ( & mut terminal, into_codes ( "c" ) ) ?;
9592 assert_eq ! (
9693 app. state. sorting,
9794 SortMode :: CountAscending ,
@@ -103,7 +100,7 @@ fn simple_user_journey_read_only() -> Result<()> {
103100 "it recomputes the cached items"
104101 ) ;
105102 // when hitting the S key
106- app. process_events ( & mut terminal, into_codes ( "s" ) , traversal_events ) ?;
103+ app. process_events ( & mut terminal, into_codes ( "s" ) ) ?;
107104 assert_eq ! (
108105 app. state. sorting,
109106 SortMode :: SizeDescending ,
@@ -115,14 +112,14 @@ fn simple_user_journey_read_only() -> Result<()> {
115112 "it recomputes the cached items"
116113 ) ;
117114 // when hitting the S key again
118- app. process_events ( & mut terminal, into_codes ( "s" ) , traversal_events ) ?;
115+ app. process_events ( & mut terminal, into_codes ( "s" ) ) ?;
119116 assert_eq ! (
120117 app. state. sorting,
121118 SortMode :: SizeAscending ,
122119 "it sets the sort mode to ascending by size"
123120 ) ;
124121 // hit the S key again to get Descending - the rest depends on it
125- app. process_events ( & mut terminal, into_codes ( "s" ) , traversal_events ) ?;
122+ app. process_events ( & mut terminal, into_codes ( "s" ) ) ?;
126123 assert_eq ! ( app. state. sorting, SortMode :: SizeDescending , ) ;
127124
128125 assert_eq ! (
@@ -135,35 +132,35 @@ fn simple_user_journey_read_only() -> Result<()> {
135132 // Entry-Navigation
136133 {
137134 // when hitting the j key
138- app. process_events ( & mut terminal, into_codes ( "j" ) , traversal_events ) ?;
135+ app. process_events ( & mut terminal, into_codes ( "j" ) ) ?;
139136 assert_eq ! (
140137 node_by_name( & app, fixture_str( long_root) ) ,
141138 node_by_index( & app, * app. state. navigation( ) . selected. as_ref( ) . unwrap( ) ) ,
142139 "it moves the cursor down and selects the next item based on the current sort mode"
143140 ) ;
144141 // when hitting it while there is nowhere to go
145- app. process_events ( & mut terminal, into_codes ( "j" ) , traversal_events ) ?;
142+ app. process_events ( & mut terminal, into_codes ( "j" ) ) ?;
146143 assert_eq ! (
147144 node_by_name( & app, fixture_str( long_root) ) ,
148145 node_by_index( & app, * app. state. navigation( ) . selected. as_ref( ) . unwrap( ) ) ,
149146 "it stays at the previous position"
150147 ) ;
151148 // when hitting the k key
152- app. process_events ( & mut terminal, into_codes ( "k" ) , traversal_events ) ?;
149+ app. process_events ( & mut terminal, into_codes ( "k" ) ) ?;
153150 assert_eq ! (
154151 node_by_name( & app, fixture_str( short_root) ) ,
155152 node_by_index( & app, * app. state. navigation( ) . selected. as_ref( ) . unwrap( ) ) ,
156153 "it moves the cursor up and selects the next item based on the current sort mode"
157154 ) ;
158155 // when hitting the k key again
159- app. process_events ( & mut terminal, into_codes ( "k" ) , traversal_events ) ?;
156+ app. process_events ( & mut terminal, into_codes ( "k" ) ) ?;
160157 assert_eq ! (
161158 node_by_name( & app, fixture_str( short_root) ) ,
162159 node_by_index( & app, * app. state. navigation( ) . selected. as_ref( ) . unwrap( ) ) ,
163160 "it stays at the current cursor position as there is nowhere to go"
164161 ) ;
165162 // when hitting the o key with a directory selected
166- app. process_events ( & mut terminal, into_codes ( "o" ) , traversal_events ) ?;
163+ app. process_events ( & mut terminal, into_codes ( "o" ) ) ?;
167164 {
168165 let new_root_idx = index_by_name ( & app, fixture_str ( short_root) ) ;
169166 assert_eq ! (
@@ -178,7 +175,7 @@ fn simple_user_journey_read_only() -> Result<()> {
178175 ) ;
179176
180177 // when hitting the u key while inside a sub-directory
181- app. process_events ( & mut terminal, into_codes ( "u" ) , traversal_events ) ?;
178+ app. process_events ( & mut terminal, into_codes ( "u" ) ) ?;
182179 {
183180 assert_eq ! (
184181 app. traversal. root_index,
@@ -194,7 +191,7 @@ fn simple_user_journey_read_only() -> Result<()> {
194191 }
195192 // when hitting the u key while inside of the root directory
196193 // We are moving the cursor down just to have a non-default selection
197- app. process_events ( & mut terminal, into_codes ( "ju" ) , traversal_events ) ?;
194+ app. process_events ( & mut terminal, into_codes ( "ju" ) ) ?;
198195 {
199196 assert_eq ! (
200197 app. traversal. root_index,
@@ -212,9 +209,9 @@ fn simple_user_journey_read_only() -> Result<()> {
212209 // Deletion
213210 {
214211 // when hitting the 'd' key (also move cursor back to start)
215- app. process_events ( & mut terminal, into_codes ( "k" ) , traversal_events ) ?;
212+ app. process_events ( & mut terminal, into_codes ( "k" ) ) ?;
216213 let previously_selected_index = * app. state . navigation ( ) . selected . as_ref ( ) . unwrap ( ) ;
217- app. process_events ( & mut terminal, into_codes ( "d" ) , traversal_events ) ?;
214+ app. process_events ( & mut terminal, into_codes ( "d" ) ) ?;
218215 {
219216 assert_eq ! (
220217 Some ( 1 ) ,
@@ -236,7 +233,7 @@ fn simple_user_journey_read_only() -> Result<()> {
236233
237234 // when hitting the 'd' key again
238235 {
239- app. process_events ( & mut terminal, into_codes ( "d" ) , traversal_events ) ?;
236+ app. process_events ( & mut terminal, into_codes ( "d" ) ) ?;
240237
241238 assert_eq ! (
242239 Some ( 2 ) ,
@@ -253,7 +250,7 @@ fn simple_user_journey_read_only() -> Result<()> {
253250
254251 // when hitting the 'd' key once again
255252 {
256- app. process_events ( & mut terminal, into_codes ( "d" ) , traversal_events ) ?;
253+ app. process_events ( & mut terminal, into_codes ( "d" ) ) ?;
257254
258255 assert_eq ! (
259256 Some ( 1 ) ,
@@ -270,7 +267,7 @@ fn simple_user_journey_read_only() -> Result<()> {
270267 }
271268 // when hitting the spacebar (after moving up to the first entry)
272269 {
273- app. process_events ( & mut terminal, into_codes ( "k " ) , traversal_events ) ?;
270+ app. process_events ( & mut terminal, into_codes ( "k " ) ) ?;
274271
275272 assert_eq ! (
276273 None ,
@@ -289,7 +286,7 @@ fn simple_user_journey_read_only() -> Result<()> {
289286 // Marking
290287 {
291288 // select something
292- app. process_events ( & mut terminal, into_codes ( " j " ) , traversal_events ) ?;
289+ app. process_events ( & mut terminal, into_codes ( " j " ) ) ?;
293290 assert_eq ! (
294291 Some ( false ) ,
295292 app. window. mark_pane. as_ref( ) . map( |p| p. has_focus( ) ) ,
@@ -306,7 +303,6 @@ fn simple_user_journey_read_only() -> Result<()> {
306303 app. process_events (
307304 & mut terminal,
308305 into_keys ( Some ( KeyCode :: Tab ) ) ,
309- traversal_events,
310306 ) ?;
311307 {
312308 assert_eq ! (
0 commit comments