Test for reading in UTF-16BE.

This commit is contained in:
Eddie Antonio Santos 2019-08-27 09:57:04 -06:00
parent 9fa24e2f6f
commit 3e030debd3
No known key found for this signature in database
GPG key ID: DD411EA4D9509D87
3 changed files with 12 additions and 0 deletions

View file

@ -0,0 +1,5 @@
const source: LexicalModelSource = {
format: 'trie-1.0',
sources: ['wordlist.txt'],
};
export default source;

Binary file not shown.

View file

@ -26,5 +26,12 @@ describe('parseWordList', function () {
let wordlist = parseWordListFromFilename(filename);
assert.lengthOf(wordlist, 10);
});
it('should read wordlists in UTF-16 LE (with BOM)', function () {
// N.B.: this format... might be output by MS Excel? Maybe?
const filename = makePathToFixture('example.qaa.utf16be', 'wordlist.txt');
let wordlist = parseWordListFromFilename(filename);
assert.lengthOf(wordlist, 10);
});
});