]> git.draconx.ca Git - slotifier.git/blob - tests/simple.at
Fix crash when input has no holes.
[slotifier.git] / tests / simple.at
1 # Copyright © 2018, 2021 Nick Bowler
2 #
3 # This program is free software: you can redistribute it and/or modify
4 # it under the terms of the GNU General Public License as published by
5 # the Free Software Foundation, either version 3 of the License, or
6 # (at your option) any later version.
7 #
8 # This program is distributed in the hope that it will be useful,
9 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
11 # GNU General Public License for more details.
12 #
13 # You should have received a copy of the GNU General Public License
14 # along with this program.  If not, see <https://www.gnu.org/licenses/>.
15
16 AT_SETUP([basic operation])
17
18 AT_DATA([test.cnc],
19 [[M48
20 INCH
21 T20C0.020
22 T19C0.035
23 %
24 T20
25 X001000Y003000
26 X001100Y003000
27 X001200Y003000
28 X001300Y003000
29 X001400Y003000
30 T19
31 X001000Y002300
32 X001000Y001600
33 X001100Y002300
34 X001200Y002300
35 X001700Y002600
36 M30
37 ]])
38
39 AT_CHECK([slotifier test.cnc], [0],
40 [[M48
41 INCH,TZ
42 T10C0.035
43 T11C0.020
44 %
45 T10
46 X001000Y002300G85X001200Y002300
47 X001000Y001600
48 X001700Y002600
49 T11
50 X001000Y003000G85X001400Y003000
51 M30
52
53 ]])
54
55 AT_CLEANUP
56
57 AT_SETUP([non-overlapping holes])
58
59 AT_DATA([test.cnc],
60 [[M48
61 INCH
62 T25C0.010
63 T24C0.091
64 %
65 T25
66 X010433Y001181
67 T24
68 X010512Y002362
69 X010512Y002047
70 M30
71 ]])
72
73 AT_CHECK([slotifier test.cnc], [0],
74 [[M48
75 INCH,TZ
76 T10C0.091
77 T11C0.010
78 %
79 T10
80 X010512Y002362G85X010512Y002047
81 T11
82 X010433Y001181
83 M30
84
85 ]])
86
87 AT_CLEANUP
88
89 AT_SETUP([no holes])
90
91 AT_DATA([test.cnc],
92 [[M48
93 INCH,TZ
94 T10C0.091
95 %
96 T10
97 X010512Y002362G85X010512Y002047
98 M30
99 ]])
100
101 AT_CHECK([slotifier test.cnc], [0],
102 [[M48
103 INCH,TZ
104 T10C0.091
105 %
106 T10
107 X010512Y002362G85X010512Y002047
108 M30
109
110 ]])
111
112 AT_CLEANUP