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

Function test_input_errors

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

Source from the content-addressed store, hash-verified

871
872 #[test]
873 fn test_input_errors() {
874 check_stmt_compilation_err("1:1: INPUT expected <vref> | <[prompt$] <,|;> vref>", "INPUT");
875 check_stmt_compilation_err(
876 "1:1: INPUT expected <vref> | <[prompt$] <,|;> vref>",
877 "INPUT ; ,",
878 );
879 check_stmt_compilation_err(
880 "1:1: INPUT expected <vref> | <[prompt$] <,|;> vref>",
881 "INPUT ;",
882 );
883 check_stmt_compilation_err("1:7: Expected STRING but found INTEGER", "INPUT 3 ; a");
884 check_stmt_compilation_err(
885 "1:13: INPUT expected <vref> | <[prompt$] <,|;> vref>",
886 "INPUT \"foo\" AS bar",
887 );
888 check_stmt_err("1:7: Undefined symbol a", "INPUT a + 1 ; b");
889 Tester::default()
890 .run("a = 3: INPUT ; a + 1")
891 .expect_compilation_err("1:16: INPUT expected <vref> | <[prompt$] <,|;> vref>")
892 .check();
893 check_stmt_err("1:11: Cannot + STRING and BOOLEAN", "INPUT \"a\" + TRUE; b?");
894 }
895
896 #[test]
897 fn test_input_propagates_interrupt_as_break() {

Callers

nothing calls this directly

Calls 5

check_stmt_errFunction · 0.85
checkMethod · 0.45
runMethod · 0.45

Tested by

no test coverage detected