Explore Help
Sign In
akira
/
pdfjs-dist
1
0
Fork
You've already forked pdfjs-dist
0
Code Issues Pull Requests Projects Releases Wiki Activity
Generic build of PDF.js library.
8998 Commits
1 Branch
1804 Tags
126 MiB
Tree: 088ce6c009
pdfjs-dist/test/unit/fonts_spec.js

14 lines
347 B
Raw Normal View History Unescape Escape

Add a unit-test to check that `ProblematicCharRanges` contains valid entries When adding new entries to `ProblematicCharRanges`, you have to be careful to not make any mistakes since that could cause glyph mapping issues. Currently the existing reference tests should probably help catch any errors, but based on experience I think that having a unit-test which specifically checks `ProblematicCharRanges` would be both helpful and timesaving when modifying/reviewing changes to this code. Hence this patch which adds a function (and unit-test) that is used to validate the entries in `ProblematicCharRanges`, and also checks that we don't accidentally add more character ranges than the Private Use Area can actually contain. The way that the validation code, and thus the unit-test, is implemented also means that we have an easy way to tell how much of the Private Use Area is potentially utilized by re-mapped characters.
9 years ago
/* globals describe, it, expect, beforeAll, afterAll,
checkProblematicCharRanges */
'use strict';
describe('Fonts', function() {
it('checkProblematicCharRanges', function() {
var EXPECTED_PERCENTAGE = 45;
var result = checkProblematicCharRanges();
expect(result.percentage).toBeLessThan(EXPECTED_PERCENTAGE);
});
});
Powered by Gitea Version: 1.16.3 Page: 351ms Template: 87ms
English
bahasa Indonesia Deutsch English español français italiano latviešu magyar nyelv Nederlands polski Português de Portugal português do Brasil suomi svenska Türkçe čeština ελληνικά български русский српски Українська فارسی മലയാളം 日本語 简体中文 繁體中文(台灣) 繁體中文(香港) 한국어
Licenses API Website Go1.17.6