mirror of
https://github.com/nodejs/node.git
synced 2025-05-18 07:36:51 +00:00

PR-URL: https://github.com/nodejs/node/pull/4958 Reviewed-By: Myles Borins <mborins@us.ibm.com> Reviewed-By: Kat Marchán <kzm@sykosomatic.org> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
27 lines
887 B
JavaScript
27 lines
887 B
JavaScript
"use strict"
|
|
var test = require("tap").test
|
|
var requireInject = require("require-inject")
|
|
|
|
test("Windows", function (t) {
|
|
t.plan(1)
|
|
var hasUnicode = requireInject("../index.js", {
|
|
os: { type: function () { return "Windows_NT" } }
|
|
})
|
|
t.is(hasUnicode(), false, "Windows is assumed NOT to be unicode aware")
|
|
})
|
|
test("Unix Env", function (t) {
|
|
t.plan(3)
|
|
var hasUnicode = requireInject("../index.js", {
|
|
os: { type: function () { return "Linux" } },
|
|
child_process: { exec: function (cmd,cb) { cb(new Error("not available")) } }
|
|
})
|
|
process.env.LANG = "en_US.UTF-8"
|
|
process.env.LC_ALL = null
|
|
t.is(hasUnicode(), true, "Linux with a UTF8 language")
|
|
process.env.LANG = null
|
|
process.env.LC_ALL = "en_US.UTF-8"
|
|
t.is(hasUnicode(), true, "Linux with UTF8 locale")
|
|
process.env.LC_ALL = null
|
|
t.is(hasUnicode(), false, "Linux without UTF8 language or locale")
|
|
})
|