Skip to content

Commit c1b951a

Browse files
committed
tests(repl-logic): man + man man
1 parent 5308795 commit c1b951a

File tree

2 files changed

+42
-0
lines changed

2 files changed

+42
-0
lines changed

crates/pluginlab/tests/e2e_test.rs

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -439,4 +439,36 @@ mod e2e_test {
439439
.exp_string("cat\tplugin\r\necho\tplugin\r\nexport\treserved\r\ngreet\tplugin\r\nhelp\treserved\r\nlist-commands\treserved\r\nman\treserved\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
}

packages/web-host/tests/repl-logic.spec.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,3 +82,13 @@ man reserved
8282
weather 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+
});

0 commit comments

Comments
 (0)