MCPcopy Index your code
hub / github.com/endbasic/endbasic / test_inkey_ok

Function test_inkey_ok

std/src/console/cmds.rs:757–779  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

755
756 #[test]
757 fn test_inkey_ok() {
758 Tester::default().run("result = INKEY").expect_var("result", "").check();
759
760 Tester::default()
761 .add_input_chars("x")
762 .run("result = INKEY")
763 .expect_var("result", "x")
764 .check();
765
766 Tester::default()
767 .add_input_keys(&[Key::CarriageReturn, Key::Backspace, Key::NewLine])
768 .run(
769 r#"
770 r1 = INKEY$
771 r2 = INKEY
772 r3 = INKEY$
773 "#,
774 )
775 .expect_var("r1", "ENTER")
776 .expect_var("r2", "BS")
777 .expect_var("r3", "ENTER")
778 .check();
779 }
780
781 #[test]
782 fn test_inkey_errors() {

Callers

nothing calls this directly

Calls 5

expect_varMethod · 0.80
add_input_keysMethod · 0.80
checkMethod · 0.45
runMethod · 0.45
add_input_charsMethod · 0.45

Tested by

no test coverage detected