File tree Expand file tree Collapse file tree 2 files changed +42
-0
lines changed
Expand file tree Collapse file tree 2 files changed +42
-0
lines changed Original file line number Diff line number Diff line change @@ -439,4 +439,36 @@ mod e2e_test {
439439 . exp_string ( "cat\t plugin\r \n echo\t plugin\r \n export\t reserved\r \n greet\t plugin\r \n help\t reserved\r \n list-commands\t reserved\r \n man\t reserved\r \n " )
440440 . expect ( "Didn't get expected list of commands" ) ;
441441 }
442+
443+ #[ test]
444+ fn test_man_command ( ) {
445+ let project_root = find_project_root ( ) ;
446+ println ! ( "Setting current directory to: {:?}" , project_root) ;
447+ std:: env:: set_current_dir ( & project_root) . unwrap ( ) ;
448+ let mut session = spawn (
449+ & build_command ( & [ "plugin_greet.wasm" ] , "repl_logic_guest.wasm" ) ,
450+ Some ( TEST_TIMEOUT ) ,
451+ )
452+ . expect ( "Can't launch pluginlab with plugin greet" ) ;
453+
454+ session
455+ . exp_string ( "[Host] Starting REPL host..." )
456+ . expect ( "Didn't see startup message" ) ;
457+ session
458+ . exp_string ( "[Host] Loading plugin:" )
459+ . expect ( "Didn't see plugin loading message" ) ;
460+ session
461+ . exp_string ( "repl(0)>" )
462+ . expect ( "Didn't see REPL prompt" ) ;
463+ session. send_line ( "man" ) . expect ( "Failed to send command" ) ;
464+ session
465+ . exp_string ( "man - Show the manual for a command" )
466+ . expect ( "Didn't get expected manual output" ) ;
467+ session
468+ . send_line ( "man man" )
469+ . expect ( "Failed to send command" ) ;
470+ session
471+ . exp_string ( "man - Show the manual for a command" )
472+ . expect ( "Didn't get expected manual output" ) ;
473+ }
442474}
Original file line number Diff line number Diff line change @@ -82,3 +82,13 @@ man reserved
8282weather plugin` ,
8383 ) ;
8484} ) ;
85+
86+ test ( "man" , async ( { page } ) => {
87+ await page . goto ( "/#repl" ) ;
88+ await fillAndSubmitCommand ( page , "man" ) ;
89+ const stdout = await getLastStd ( page , "stdout" ) ;
90+ await expect ( stdout ) . toContainText ( "man - Show the manual for a command" ) ;
91+ await fillAndSubmitCommand ( page , "man man" ) ;
92+ const stdout2 = await getLastStd ( page , "stdout" ) ;
93+ await expect ( stdout2 ) . toContainText ( "man - Show the manual for a command" ) ;
94+ } ) ;
You can’t perform that action at this time.
0 commit comments