def test_repr(): g = GCode.from_string(COMMAND) assert str(g) == "G01 X00 Y-0.1 (comment1) ;comment2"
def test_get_word(): g = GCode.from_string(COMMAND) result = g.get_code_word("X") assert result == ("X", 0.0) result = g.get_code_word("Z") assert result is None
def test_get_position(): g = GCode.from_string(COMMAND) position = g.get_position() assert position == {"X": 0, "Y": -0.1}
def test_gcode_parse(): g = GCode.from_string(COMMAND) assert g == GCODE