@@ -38,14 +38,17 @@ fn shell_command_via_mbang_displays_short_output() {
3838#[ test]
3939fn shell_command_empty_prompt_multiple_del_keeps_prompt ( ) {
4040 let ( mut gnu, mut neo) = boot_pair ( "" ) ;
41+ let trace = CommandTrace :: install ( & mut gnu, & mut neo) ;
4142
4243 send_both ( & mut gnu, & mut neo, "M-!" ) ;
4344 let prompt_ready = |grid : & [ String ] | grid. iter ( ) . any ( |row| row. contains ( "Shell command:" ) ) ;
4445 gnu. read_until ( Duration :: from_secs ( 6 ) , prompt_ready) ;
4546 neo. read_until ( Duration :: from_secs ( 8 ) , prompt_ready) ;
4647 read_both ( & mut gnu, & mut neo, Duration :: from_millis ( 300 ) ) ;
4748
49+ let baseline = trace. mark ( ) ;
4850 send_both ( & mut gnu, & mut neo, "DEL DEL DEL" ) ;
51+ trace. wait_for ( & mut gnu, & mut neo, baseline, 3 , Duration :: from_secs ( 8 ) ) ;
4952
5053 let prompt_intact = |grid : & [ String ] | {
5154 grid. iter ( ) . any ( |row| row. contains ( "Shell command:" ) )
@@ -160,6 +163,7 @@ fn async_shell_command_via_mampersand_displays_output_buffer() {
160163#[ test]
161164fn async_shell_command_empty_prompt_multiple_del_keeps_prompt ( ) {
162165 let ( mut gnu, mut neo) = boot_pair ( "" ) ;
166+ let trace = CommandTrace :: install ( & mut gnu, & mut neo) ;
163167
164168 send_both ( & mut gnu, & mut neo, "M-&" ) ;
165169 let prompt_ready =
@@ -168,7 +172,9 @@ fn async_shell_command_empty_prompt_multiple_del_keeps_prompt() {
168172 neo. read_until ( Duration :: from_secs ( 8 ) , prompt_ready) ;
169173 read_both ( & mut gnu, & mut neo, Duration :: from_millis ( 300 ) ) ;
170174
175+ let baseline = trace. mark ( ) ;
171176 send_both ( & mut gnu, & mut neo, "DEL DEL DEL" ) ;
177+ trace. wait_for ( & mut gnu, & mut neo, baseline, 3 , Duration :: from_secs ( 8 ) ) ;
172178
173179 let prompt_intact = |grid : & [ String ] | {
174180 grid. iter ( ) . any ( |row| row. contains ( "Async shell command:" ) )
@@ -443,14 +449,17 @@ fn compile_via_mx_runs_command_in_compilation_buffer() {
443449#[ test]
444450fn compile_empty_prompt_multiple_del_keeps_prompt ( ) {
445451 let ( mut gnu, mut neo) = boot_pair ( "" ) ;
452+ let trace = CommandTrace :: install ( & mut gnu, & mut neo) ;
446453
447454 invoke_mx_command ( & mut gnu, & mut neo, "compile" ) ;
448455 let prompt_ready = |grid : & [ String ] | grid. iter ( ) . any ( |row| row. contains ( "Compile command:" ) ) ;
449456 gnu. read_until ( Duration :: from_secs ( 8 ) , prompt_ready) ;
450457 neo. read_until ( Duration :: from_secs ( 10 ) , prompt_ready) ;
451458 read_both ( & mut gnu, & mut neo, Duration :: from_millis ( 300 ) ) ;
452459
460+ let baseline = trace. mark ( ) ;
453461 send_both ( & mut gnu, & mut neo, "C-a C-k DEL DEL DEL" ) ;
462+ trace. wait_for ( & mut gnu, & mut neo, baseline, 5 , Duration :: from_secs ( 8 ) ) ;
454463
455464 let prompt_intact = |grid : & [ String ] | {
456465 grid. iter ( ) . any ( |row| row. contains ( "Compile command:" ) )
@@ -500,12 +509,8 @@ fn grep_via_mx_lists_matching_file_lines() {
500509
501510 let ready = |grid : & [ String ] | {
502511 grid. iter ( ) . any ( |row| row. contains ( "*grep*" ) )
503- && grid
504- . iter ( )
505- . any ( |row| row. contains ( "grep-usage.txt:1:alpha needle one" ) )
506- && grid
507- . iter ( )
508- . any ( |row| row. contains ( "grep-usage.txt:3:gamma needle two" ) )
512+ && grid. iter ( ) . any ( |row| row. contains ( "1:alpha needle one" ) )
513+ && grid. iter ( ) . any ( |row| row. contains ( "3:gamma needle two" ) )
509514 } ;
510515 gnu. read_until ( Duration :: from_secs ( 12 ) , ready) ;
511516 neo. read_until ( Duration :: from_secs ( 14 ) , ready) ;
@@ -532,6 +537,7 @@ fn grep_via_mx_lists_matching_file_lines() {
532537#[ test]
533538fn grep_empty_prompt_multiple_del_keeps_prompt ( ) {
534539 let ( mut gnu, mut neo) = boot_pair ( "" ) ;
540+ let trace = CommandTrace :: install ( & mut gnu, & mut neo) ;
535541 open_home_file (
536542 & mut gnu,
537543 & mut neo,
@@ -547,7 +553,9 @@ fn grep_empty_prompt_multiple_del_keeps_prompt() {
547553 neo. read_until ( Duration :: from_secs ( 10 ) , prompt_ready) ;
548554 read_both ( & mut gnu, & mut neo, Duration :: from_millis ( 300 ) ) ;
549555
556+ let baseline = trace. mark ( ) ;
550557 send_both ( & mut gnu, & mut neo, "C-a C-k DEL DEL DEL" ) ;
558+ trace. wait_for ( & mut gnu, & mut neo, baseline, 5 , Duration :: from_secs ( 8 ) ) ;
551559
552560 let prompt_intact = |grid : & [ String ] | {
553561 grid. iter ( ) . any ( |row| row. contains ( "Run grep (like this):" ) )
@@ -672,6 +680,7 @@ fn diff_buffer_with_file_via_mx_shows_unsaved_changes() {
672680#[ test]
673681fn diff_buffer_with_file_empty_prompt_multiple_del_keeps_prompt ( ) {
674682 let ( mut gnu, mut neo) = boot_pair_editing_a_shared_file ( ) ;
683+ let trace = CommandTrace :: install ( & mut gnu, & mut neo) ;
675684 let shared_path = write_shared_temp_file ( "diff-buffer-empty-del.txt" , "alpha\n beta\n " ) ;
676685 open_shared_file ( & mut gnu, & mut neo, & shared_path, "C-x C-f" ) ;
677686
@@ -681,7 +690,9 @@ fn diff_buffer_with_file_empty_prompt_multiple_del_keeps_prompt() {
681690 neo. read_until ( Duration :: from_secs ( 8 ) , prompt_ready) ;
682691 read_both ( & mut gnu, & mut neo, Duration :: from_millis ( 300 ) ) ;
683692
693+ let baseline = trace. mark ( ) ;
684694 send_both ( & mut gnu, & mut neo, "DEL DEL DEL" ) ;
695+ trace. wait_for ( & mut gnu, & mut neo, baseline, 3 , Duration :: from_secs ( 8 ) ) ;
685696
686697 let prompt_intact = |grid : & [ String ] | {
687698 grid. iter ( ) . any ( |row| row. contains ( "Buffer (default" ) )
@@ -759,6 +770,7 @@ fn shell_command_on_region_via_mbar_with_cat_preserves_text() {
759770#[ test]
760771fn shell_command_on_region_empty_prompt_multiple_del_keeps_prompt ( ) {
761772 let ( mut gnu, mut neo) = boot_pair ( "" ) ;
773+ let trace = CommandTrace :: install ( & mut gnu, & mut neo) ;
762774
763775 open_home_file (
764776 & mut gnu,
@@ -777,7 +789,9 @@ fn shell_command_on_region_empty_prompt_multiple_del_keeps_prompt() {
777789 neo. read_until ( Duration :: from_secs ( 8 ) , prompt_ready) ;
778790 read_both ( & mut gnu, & mut neo, Duration :: from_millis ( 300 ) ) ;
779791
792+ let baseline = trace. mark ( ) ;
780793 send_both ( & mut gnu, & mut neo, "DEL DEL DEL" ) ;
794+ trace. wait_for ( & mut gnu, & mut neo, baseline, 3 , Duration :: from_secs ( 8 ) ) ;
781795
782796 let prompt_intact = |grid : & [ String ] | {
783797 grid. iter ( )
0 commit comments