chardet/test/encodings/unicode.js

36 lines
717 B
JavaScript
Raw Permalink Normal View History

2013-04-29 14:31:48 +00:00
var assert = require('assert'),
2013-11-22 04:40:19 +00:00
chardet = require('../../');
describe('Unicode', function() {
2013-11-22 04:40:19 +00:00
var base = __dirname + '/../data/encodings';
2013-04-29 14:31:48 +00:00
2013-11-22 04:40:19 +00:00
it('should return UTF-16LE', function() {
assert.equal(
chardet.detectFileSync(base + '/utf16le'),
'UTF-16LE'
);
});
2013-04-29 14:31:48 +00:00
2013-11-22 04:40:19 +00:00
it('should return UTF-16BE', function() {
assert.equal(
chardet.detectFileSync(base + '/utf16be'),
'UTF-16BE'
);
});
2013-04-29 14:31:48 +00:00
2013-11-22 04:40:19 +00:00
it('should return UTF-32LE', function() {
assert.equal(
chardet.detectFileSync(base + '/utf32le'),
'UTF-32LE'
);
});
2013-04-29 14:31:48 +00:00
2013-11-22 04:40:19 +00:00
it('should return UTF-32BE', function() {
assert.equal(
chardet.detectFileSync(base + '/utf32be'),
'UTF-32BE'
);
});
});