spec: Test localeCompare in child process
This commit is contained in:
parent
51c03c3a71
commit
f81df9a5d3
2 changed files with 14 additions and 0 deletions
7
spec/fixtures/module/locale-compare.js
vendored
Normal file
7
spec/fixtures/module/locale-compare.js
vendored
Normal file
|
@ -0,0 +1,7 @@
|
|||
process.on('message', function (msg) {
|
||||
process.send([
|
||||
'a'.localeCompare('a'),
|
||||
'ä'.localeCompare('z', 'de'),
|
||||
'ä'.localeCompare('a', 'sv', { sensitivity: 'base' }),
|
||||
]);
|
||||
});
|
|
@ -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) ->
|
||||
|
|
Loading…
Reference in a new issue