'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() {
      var output;
      waitsFor(function() { return output; }, 10000);
      var font = new Font("font", new Stream(font2324), {
        loadedName: 'font',
        type: 'CIDFontType2',
        differences: [],
        defaultEncoding: [],
        cMap: CMapFactory.create(new Name('Identity-H'))
      });
      ttx(font.data, function(result) { output = result; });
      runs(function() {
        verifyTtxOutput(output);
        expect(/(ENDF\[ \]|SVTCA\[0\])\s*<\/assembly>\s*<\/fpgm>/.test(output)).toEqual(true);
      });
    });
  });
});
