()
| 798 | |
| 799 | #[test] |
| 800 | fn test_input_ok() { |
| 801 | fn t(stmt: &str, input: &str, output: &str) { |
| 802 | Tester::default().add_input_chars(input).run(stmt).expect_prints([output]).check(); |
| 803 | } |
| 804 | |
| 805 | t("INPUT foo\nPRINT foo", "9\n", " 9"); |
| 806 | t("INPUT ; foo\nPRINT foo", "9\n", " 9"); |
| 807 | t("INPUT ; foo\nPRINT foo", "-9\n", "-9"); |
| 808 | t("INPUT , bar?\nPRINT bar", "true\n", "TRUE"); |
| 809 | t("INPUT ; foo$\nPRINT foo", "\n", ""); |
| 810 | t("INPUT \"With question mark\"; a$\nPRINT a$", "some long text\n", "some long text"); |
| 811 | |
| 812 | Tester::default() |
| 813 | .add_input_chars("42\n") |
| 814 | .run("prompt$ = \"Indirectly without question mark\"\nINPUT prompt$, b\nPRINT b * 2") |
| 815 | .expect_prints([" 84"]) |
| 816 | .check(); |
| 817 | } |
| 818 | |
| 819 | #[test] |
| 820 | fn test_input_on_predefined_vars() { |
nothing calls this directly
no test coverage detected