https://github.com/mozilla/pdf.js/issues/6397#issuecomment-164954332 Would have been a lot easier to find had there been an assertion checking that string16 didn't go out of bounds of the 16bit number.

verifyTtxOutput(output);
      expect(/<post>\s*<formatType value="3\.0"\/>/.test(output)).toEqual(true);
    });
    it("has invalid glyph name indexes", async function () {
      const font = new Font("font", new Stream(font2189), {
        loadedName: "font",
        type: "TrueType",
        differences: [],
        defaultEncoding: [],
        toUnicode: new ToUnicodeMap([]),
      });
      const output = await ttx(font.data);
      verifyTtxOutput(output);
      expect(/<post>\s*<formatType value="3\.0"\/>/.test(output)).toEqual(true);
    });
    it("has right amount of glyphs specified", async function () {
      const font = new Font("font", new Stream(font2374), {
        loadedName: "font",
        type: "TrueType",
        differences: [],
        defaultEncoding: [],
        toUnicode: new ToUnicodeMap([]),
      });
      const output = await ttx(font.data);
      verifyTtxOutput(output);
      expect(/<post>\s*<formatType value="3\.0"\/>/.test(output)).toEqual(true);
    });
  });
});