"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const core_1 = require("../../../src/core");
const utils_1 = require("../../../src/utils");
describe(`PDFHeader`, () => {
    it(`can be constructed from PDFHeader.forVersion(...)`, () => {
        expect(core_1.PDFHeader.forVersion(1, 2)).toBeInstanceOf(core_1.PDFHeader);
    });
    it(`can be converted to a string`, () => {
        expect(String(core_1.PDFHeader.forVersion(1, 7))).toBe('%PDF-1.7\n%');
    });
    it(`can provide its size in bytes`, () => {
        expect(core_1.PDFHeader.forVersion(81, 79).sizeInBytes()).toBe(16);
    });
    it(`can be serialized`, () => {
        const buffer = new Uint8Array(20).fill((0, utils_1.toCharCode)(' '));
        expect(core_1.PDFHeader.forVersion(79, 81).copyBytesInto(buffer, 3)).toBe(16);
        expect(buffer).toEqual((0, utils_1.typedArrayFor)('   %PDF-79.81\n% '));
    });
});
//# sourceMappingURL=PDFHeader.spec.js.map