From: Cheng Zhao Date: Sat, 17 Jan 2015 00:11:02 +0000 (-0800) Subject: spec: Test localeCompare in child process X-Git-Tag: v0.20.7~11^2~1 X-Git-Url: http://git.khamidou.com/?a=commitdiff_plain;h=f81df9a5d3df0b8621e9b81bbfb9b05d49d1f8cb;p=electron.git spec: Test localeCompare in child process --- diff --git a/spec/fixtures/module/locale-compare.js b/spec/fixtures/module/locale-compare.js new file mode 100644 index 00000000..f99e7c3b --- /dev/null +++ b/spec/fixtures/module/locale-compare.js @@ -0,0 +1,7 @@ +process.on('message', function (msg) { + process.send([ + 'a'.localeCompare('a'), + 'ä'.localeCompare('z', 'de'), + 'ä'.localeCompare('a', 'sv', { sensitivity: 'base' }), + ]); +}); diff --git a/spec/node-spec.coffee b/spec/node-spec.coffee index 3a201383..89944683 100644 --- a/spec/node-spec.coffee +++ b/spec/node-spec.coffee @@ -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) ->