MCPcopy Create free account
hub / github.com/256dpi/gcode / TestParse

Function TestParse

parse_test.go:23–97  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

21`
22
23func 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},

Callers

nothing calls this directly

Calls 1

ParseFileFunction · 0.85

Tested by

no test coverage detected