test: Add case for #634

This commit is contained in:
Cheng Zhao 2015-05-27 15:26:32 +08:00
parent 1c60575dc0
commit f961f0617f

View file

@ -126,3 +126,10 @@ describe 'node feature', ->
b = new Buffer(p.innerText) b = new Buffer(p.innerText)
assert.equal b.toString(), '闲云潭影日悠悠,物换星移几度秋' assert.equal b.toString(), '闲云潭影日悠悠,物换星移几度秋'
assert.equal Buffer.byteLength(p.innerText), 45 assert.equal Buffer.byteLength(p.innerText), 45
it 'correctly parses external one-byte UTF8 string', ->
p = document.createElement 'p'
p.innerText = 'Jøhänñéß'
b = new Buffer(p.innerText)
assert.equal b.toString(), 'Jøhänñéß'
assert.equal Buffer.byteLength(p.innerText), 13