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

Function test_input_retry

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

Source from the content-addressed store, hash-verified

840
841 #[test]
842 fn test_input_retry() {
843 Tester::default()
844 .add_input_chars("\ntrue\n")
845 .run("DIM b AS BOOLEAN: INPUT ; b?")
846 .expect_prints(["Retry input: Invalid boolean literal "])
847 .expect_var("b", true)
848 .check();
849
850 Tester::default()
851 .add_input_chars("0\ntrue\n")
852 .run("DIM b AS BOOLEAN: INPUT ; b?")
853 .expect_prints(["Retry input: Invalid boolean literal 0"])
854 .expect_var("b", true)
855 .check();
856
857 Tester::default()
858 .add_input_chars("\n7\n")
859 .run("DIM a: a = 3: INPUT ; a")
860 .expect_prints(["Retry input: Invalid integer literal "])
861 .expect_var("a", 7)
862 .check();
863
864 Tester::default()
865 .add_input_chars("x\n7\n")
866 .run("DIM a: a = 3: INPUT ; a")
867 .expect_prints(["Retry input: Invalid integer literal x"])
868 .expect_var("a", 7)
869 .check();
870 }
871
872 #[test]
873 fn test_input_errors() {

Callers

nothing calls this directly

Calls 5

expect_varMethod · 0.80
checkMethod · 0.45
expect_printsMethod · 0.45
runMethod · 0.45
add_input_charsMethod · 0.45

Tested by

no test coverage detected