textfile - add test for UTF16 without bom

This commit is contained in:
Benjamin Pasero
2019-04-16 19:04:35 +02:00
parent 38cad5d4f6
commit 6028545f2d
3 changed files with 14 additions and 0 deletions
@@ -556,6 +556,20 @@ suite('Files - TextFileService i/o', () => {
assert.ok(contents.indexOf(needle, 10) > 0);
}
test('readStream - UTF16 LE (no BOM)', async () => {
const resource = URI.file(join(testDir, 'utf16_le_nobom.txt'));
const result = await service.readStream(resource);
assert.equal(result.encoding, 'utf16le');
});
test('readStream - UTF16 BE (no BOM)', async () => {
const resource = URI.file(join(testDir, 'utf16_be_nobom.txt'));
const result = await service.readStream(resource);
assert.equal(result.encoding, 'utf16be');
});
test('readStream - FILE_IS_BINARY', async () => {
const resource = URI.file(join(testDir, 'binary.txt'));