(t *testing.T)
| 21 | ` |
| 22 | |
| 23 | func TestParse(t *testing.T) { |
| 24 | r := strings.NewReader(testGCode) |
| 25 | |
| 26 | file, err := ParseFile(r) |
| 27 | assert.NoError(t, err) |
| 28 | assert.Equal(t, &File{ |
| 29 | Lines: []Line{ |
| 30 | { |
| 31 | Comment: " Line Comment", |
| 32 | }, |
| 33 | { |
| 34 | Comment: " After Line Comment", |
| 35 | Codes: []GCode{ |
| 36 | {Letter: "G", Value: 1}, |
| 37 | }, |
| 38 | }, |
| 39 | { |
| 40 | Codes: []GCode{ |
| 41 | {Comment: "Word Comment"}, |
| 42 | }, |
| 43 | }, |
| 44 | { |
| 45 | Codes: []GCode{ |
| 46 | {Letter: "G", Value: 2}, |
| 47 | {Comment: "Word Comment"}, |
| 48 | {Letter: "M", Value: 1}, |
| 49 | }, |
| 50 | }, |
| 51 | { |
| 52 | Codes: []GCode{ |
| 53 | {Letter: "G", Value: 3}, |
| 54 | {Comment: "Word Comment"}, |
| 55 | {Letter: "M", Value: 2}, |
| 56 | {Comment: "Word Comment"}, |
| 57 | {Letter: "M", Value: 3}, |
| 58 | }, |
| 59 | }, |
| 60 | { |
| 61 | Codes: []GCode{ |
| 62 | {Letter: "G", Value: 4}, |
| 63 | }, |
| 64 | }, |
| 65 | { |
| 66 | Codes: []GCode{ |
| 67 | {Letter: "G", Value: 5}, |
| 68 | {Letter: "X"}, |
| 69 | {Letter: "Y"}, |
| 70 | }, |
| 71 | }, |
| 72 | { |
| 73 | Codes: []GCode{ |
| 74 | {Letter: "G", Value: 6}, |
| 75 | {Letter: "Z", Value: 12.7}, |
| 76 | }, |
| 77 | }, |
| 78 | { |
| 79 | Codes: []GCode{ |
| 80 | {Letter: "G", Value: 7}, |
nothing calls this directly
no test coverage detected