# Copyright © 2018, 2021 Nick Bowler # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . AT_SETUP([basic operation]) AT_DATA([test.cnc], [[M48 INCH T20C0.020 T19C0.035 % T20 X001000Y003000 X001100Y003000 X001200Y003000 X001300Y003000 X001400Y003000 T19 X001000Y002300 X001000Y001600 X001100Y002300 X001200Y002300 X001700Y002600 M30 ]]) AT_CHECK([slotifier test.cnc], [0], [[M48 INCH,TZ T10C0.035 T11C0.020 % T10 X001000Y002300G85X001200Y002300 X001000Y001600 X001700Y002600 T11 X001000Y003000G85X001400Y003000 M30 ]]) AT_CLEANUP AT_SETUP([non-overlapping holes]) AT_DATA([test.cnc], [[M48 INCH T25C0.010 T24C0.091 % T25 X010433Y001181 T24 X010512Y002362 X010512Y002047 M30 ]]) AT_CHECK([slotifier test.cnc], [0], [[M48 INCH,TZ T10C0.091 T11C0.010 % T10 X010512Y002362G85X010512Y002047 T11 X010433Y001181 M30 ]]) AT_CLEANUP AT_SETUP([no holes]) AT_DATA([test.cnc], [[M48 INCH,TZ T10C0.091 % T10 X010512Y002362G85X010512Y002047 M30 ]]) AT_CHECK([slotifier test.cnc], [0], [[M48 INCH,TZ T10C0.091 % T10 X010512Y002362G85X010512Y002047 M30 ]]) AT_CLEANUP AT_SETUP([asymmetric overlap]) AT_DATA([test.cnc], [[M48 INCH T25C0.025 T24C0.050 % T25 X010200Y010000 X010300Y010000 T24 X010000Y010000 M30 ]]) AT_CHECK([slotifier test.cnc], [0], [[M48 INCH,TZ T10C0.050 T11C0.025 % T10 X010000Y010000G85X010300Y010000 T11 M30 ]]) AT_CLEANUP AT_SETUP([asymmetric overlap #2]) AT_DATA([test.cnc], [[M48 INCH T25C0.030 T24C0.100 % T25 X010400Y010250 T24 X010800Y010000 X010000Y010000 M30 ]]) AT_CHECK([slotifier test.cnc], [0], [[M48 INCH,TZ T10C0.100 T11C0.030 % T10 X010800Y010000G85X010000Y010000 T11 M30 ]]) AT_CLEANUP