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

Function test_do_errors

core/src/parser.rs:2896–2927  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

2894
2895 #[test]
2896 fn test_do_errors() {
2897 do_error_test("DO\n", "1:1: DO without LOOP");
2898 do_error_test("DO FOR\n", "1:4: Expecting newline, UNTIL or WHILE after DO");
2899
2900 do_error_test("\n\nDO UNTIL TRUE\n", "3:1: DO without LOOP");
2901 do_error_test("\n\nDO WHILE TRUE\n", "3:1: DO without LOOP");
2902 do_error_test("DO UNTIL TRUE\nEND", "1:1: DO without LOOP");
2903 do_error_test("DO WHILE TRUE\nEND", "1:1: DO without LOOP");
2904 do_error_test("DO UNTIL TRUE\nEND\n", "1:1: DO without LOOP");
2905 do_error_test("DO WHILE TRUE\nEND\n", "1:1: DO without LOOP");
2906 do_error_test("DO UNTIL TRUE\nEND WHILE\n", "2:5: Unexpected keyword in expression");
2907 do_error_test("DO WHILE TRUE\nEND WHILE\n", "2:5: Unexpected keyword in expression");
2908
2909 do_error_test("DO UNTIL\n", "1:9: No expression in UNTIL clause");
2910 do_error_test("DO WHILE\n", "1:9: No expression in WHILE clause");
2911 do_error_test("DO UNTIL TRUE", "1:14: Expecting newline after DO");
2912 do_error_test("DO WHILE TRUE", "1:14: Expecting newline after DO");
2913
2914 do_error_test("DO\nLOOP UNTIL", "2:11: No expression in UNTIL clause");
2915 do_error_test("DO\nLOOP WHILE\n", "2:11: No expression in WHILE clause");
2916
2917 do_error_test("DO UNTIL ,\nLOOP", "1:10: No expression in UNTIL clause");
2918 do_error_test("DO WHILE ,\nLOOP", "1:10: No expression in WHILE clause");
2919
2920 do_error_test("DO\nLOOP UNTIL ,\n", "2:12: No expression in UNTIL clause");
2921 do_error_test("DO\nLOOP WHILE ,\n", "2:12: No expression in WHILE clause");
2922
2923 do_error_test(
2924 "DO WHILE TRUE\nLOOP UNTIL FALSE",
2925 "1:1: DO loop cannot have pre and post guards at the same time",
2926 );
2927 }
2928
2929 #[test]
2930 fn test_exit_do() {

Callers

nothing calls this directly

Calls 1

do_error_testFunction · 0.85

Tested by

no test coverage detected