Tests a G-code program from a string for validity by loading and validating its G-code lines.
test_code(gcode_string)
Test G-Code from a string for validity
test_code("G21\nG0 X10 Y10\nM3\nG1 X50 Y50 F1000\nM5"); // returns 0 if valid, or an error line number
Test another G-Code program from a string
test_code("G90\nG0 Z5\nG1 X100 Y100 Z0 F500"); // returns 0 if valid, or an error line number