2010-03-09 07:06:29 +08:00
|
|
|
require("../common");
|
2009-11-12 01:10:58 +08:00
|
|
|
|
2009-11-29 01:26:59 +08:00
|
|
|
assert.equal(14, process._byteLength("Il était tué"));
|
|
|
|
assert.equal(14, process._byteLength("Il était tué", "utf8"));
|
2009-11-12 01:10:58 +08:00
|
|
|
|
2009-11-29 01:26:59 +08:00
|
|
|
assert.equal(12, process._byteLength("Il était tué", "ascii"));
|
2009-11-12 01:10:58 +08:00
|
|
|
|
2009-11-29 01:26:59 +08:00
|
|
|
assert.equal(12, process._byteLength("Il était tué", "binary"));
|
2009-11-12 01:10:58 +08:00
|
|
|
|
2009-11-29 01:26:59 +08:00
|
|
|
assert.throws(function() {
|
|
|
|
process._byteLength();
|
|
|
|
});
|
|
|
|
assert.throws(function() {
|
|
|
|
process._byteLength(5);
|
2010-02-22 08:53:20 +08:00
|
|
|
});
|