'use strict';

describe('font_fpgm', function() {
  var font2324 = decodeFontData('[encoded data, 93160 characters]');
  describe('Fixes fpgm table', function() {
    it('table was truncated in the middle of functions', function(done) {
      CMapFactory.create({
        encoding: Name.get('Identity-H'),
      }).then(function (cMap) {
        var font = new Font("font", new Stream(font2324), {
          loadedName: 'font',
          type: 'CIDFontType2',
          differences: [],
          defaultEncoding: [],
          cMap: cMap,
          toUnicode: new ToUnicodeMap([])
        });
        ttx(font.data, function(output) {
          verifyTtxOutput(output);
          expect(/(ENDF\[ \]|SVTCA\[0\])\s*<\/assembly>\s*<\/fpgm>/.test(output)).toEqual(true);
          done();
        });
      });
    });
  });
});
