@@ -45,6 +45,18 @@ def test_binhex_error_on_long_filename(self):
|
45 | 45 | |
46 | 46 | self.assertRaises(binhex.Error, binhex.binhex, self.fname3, self.fname2) |
47 | 47 | |
| 48 | +def test_binhex_line_endings(self): |
| 49 | +# bpo-29566: Ensure the line endings are those for macOS 9 |
| 50 | +with open(self.fname1, 'wb') as f: |
| 51 | +f.write(self.DATA) |
| 52 | + |
| 53 | +binhex.binhex(self.fname1, self.fname2) |
| 54 | + |
| 55 | +with open(self.fname2, 'rb') as fp: |
| 56 | +contents = fp.read() |
| 57 | + |
| 58 | +self.assertNotIn(b'\n', contents) |
| 59 | + |
48 | 60 | def test_main(): |
49 | 61 | support.run_unittest(BinHexTestCase) |
50 | 62 | |
|