spec: Test localeCompare in child process

This commit is contained in:
Cheng Zhao 2015-01-16 16:11:02 -08:00
parent 51c03c3a71
commit f81df9a5d3
2 changed files with 14 additions and 0 deletions

View file

@ -0,0 +1,7 @@
process.on('message', function (msg) {
process.send([
'a'.localeCompare('a'),
'ä'.localeCompare('z', 'de'),
'ä'.localeCompare('a', 'sv', { sensitivity: 'base' }),
]);
});

View file

@ -41,6 +41,13 @@ describe 'node feature', ->
done()
child.send 'message'
it 'has String::localeCompare working in script', (done) ->
child = child_process.fork path.join(fixtures, 'module', 'locale-compare.js')
child.on 'message', (msg) ->
assert.deepEqual msg, [0, -1, 1]
done()
child.send 'message'
describe 'contexts', ->
describe 'setTimeout in fs callback', ->
it 'does not crash', (done) ->