chardet/src/encoding/unicode.test.ts

22 lines
590 B
TypeScript
Raw Normal View History

import * as chardet from '..';
describe('Unicode', () => {
2020-09-23 02:16:38 +00:00
const base = __dirname + '/../test/data/encodings';
it('should return UTF-16LE', () => {
expect(chardet.detectFileSync(base + '/utf16le')).toBe('UTF-16LE');
});
it('should return UTF-16BE', () => {
expect(chardet.detectFileSync(base + '/utf16be')).toBe('UTF-16BE');
});
it('should return UTF-32LE', () => {
expect(chardet.detectFileSync(base + '/utf32le')).toBe('UTF-32LE');
});
it('should return UTF-32BE', () => {
expect(chardet.detectFileSync(base + '/utf32be')).toBe('UTF-32BE');
});
});