mirror of
https://github.com/foliojs/pdfkit.git
synced 2025-12-08 20:15:54 +00:00
24 lines
680 B
JavaScript
24 lines
680 B
JavaScript
import PDFObject from '../../lib/object';
|
||
|
||
describe('PDFObject', () => {
|
||
describe('convert', () => {
|
||
test('string literal', () => {
|
||
expect(PDFObject.convert('test')).toEqual('/test');
|
||
});
|
||
|
||
test('string literal with unicode', () => {
|
||
expect(PDFObject.convert('αβγδ')).toEqual('/αβγδ');
|
||
});
|
||
|
||
test('String object', () => {
|
||
expect(PDFObject.convert(new String('test'))).toEqual('(test)');
|
||
});
|
||
|
||
test('String object with unicode', () => {
|
||
const result = PDFObject.convert(new String('αβγδ'));
|
||
expect(result.length).toEqual(12);
|
||
expect(result).toMatchInlineSnapshot(`"(þÿ±²³´)"`);
|
||
});
|
||
});
|
||
});
|