summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/data/ref_gerber_single_quadrant.gtl40
-rw-r--r--tests/expects/RS2724x_single_quadrant.gtl35
-rw-r--r--tests/test_rs274x.py7
3 files changed, 82 insertions, 0 deletions
diff --git a/tests/data/ref_gerber_single_quadrant.gtl b/tests/data/ref_gerber_single_quadrant.gtl
new file mode 100644
index 0000000..f31f1e7
--- /dev/null
+++ b/tests/data/ref_gerber_single_quadrant.gtl
@@ -0,0 +1,40 @@
+%MOMM*%
+%FSLAX34Y34*%
+%IPPOS*%
+%ADD10C,0.1*%
+G74*
+%LPD*%
+
+D10*
+
+G36*
+G01*
+X0Y10000D02*
+Y90000D01*
+G02*
+X10000Y100000I10000*
+X20000Y90000J10000*
+G01*
+Y20000*
+X40000*
+G02*
+X50000Y10000J10000*
+X40000Y0I10000*
+G01*
+X10000*
+G02*
+X0Y10000J10000*
+G37*
+
+G03*
+X70000Y50000D02*
+X60000Y60000I10000D01*
+X50000Y50000J10000*
+X60000Y40000I10000*
+X70000Y50000J10000*
+
+G02*
+X60000Y90000D02*
+X60000Y90000I10000D01*
+
+M02*
diff --git a/tests/expects/RS2724x_single_quadrant.gtl b/tests/expects/RS2724x_single_quadrant.gtl
new file mode 100644
index 0000000..dbec705
--- /dev/null
+++ b/tests/expects/RS2724x_single_quadrant.gtl
@@ -0,0 +1,35 @@
+%MOMM*%
+%FSLAX34Y34*%
+%IPPOS*%
+%ADD10C,0.1*%
+G75*
+%LPD*%
+D10*
+G36*
+G01*
+X0Y10000D02*
+X0Y90000D01*
+G02*
+X10000Y100000I10000J0D01*
+X20000Y90000I0J-10000D01*
+G01*
+X20000Y20000D01*
+X40000Y20000D01*
+G02*
+X50000Y10000I0J-10000D01*
+X40000Y0I-10000J0D01*
+G01*
+X10000Y0D01*
+G02*
+X0Y10000I0J10000D01*
+G37*
+G03*
+X70000Y50000D02*
+X60000Y60000I-10000J0D01*
+X50000Y50000I0J-10000D01*
+X60000Y40000I10000J0D01*
+X70000Y50000I0J10000D01*
+G02*
+X60000Y90000D02*
+X60000Y90000I0J0D01*
+M02*
diff --git a/tests/test_rs274x.py b/tests/test_rs274x.py
index 3e44066..dbb5f62 100644
--- a/tests/test_rs274x.py
+++ b/tests/test_rs274x.py
@@ -17,6 +17,7 @@ class TestRs274x(unittest.TestCase):
cls.OUTPREFIX = 'RS2724x_'
cls.METRIC_FILE = os.path.join(cls.INDIR, 'ref_gerber_metric.gtl')
cls.INCH_FILE = os.path.join(cls.INDIR, 'ref_gerber_inch.gtl')
+ cls.SQ_FILE = os.path.join(cls.INDIR, 'ref_gerber_single_quadrant.gtl')
try:
os.mkdir(cls.OUTDIR)
except FileExistsError:
@@ -65,5 +66,11 @@ class TestRs274x(unittest.TestCase):
gerber.write(outfile)
self._checkResult(outfile)
+ def test_single_quadrant(self):
+ outfile = os.path.join(self.OUTDIR, self.OUTPREFIX + 'single_quadrant.gtl')
+ gerber = gerberex.read(self.SQ_FILE)
+ gerber.write(outfile)
+ self._checkResult(outfile)
+
if __name__ == '__main__':
unittest.main()