]> gerrit.simantics Code Review - simantics/district.git/blob - org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npmlog/node_modules/gauge/node_modules/has-unicode/test/index.js
Adding integrated tile server
[simantics/district.git] / org.simantics.maps.server / node / node-v4.8.0-win-x64 / node_modules / npm / node_modules / npmlog / node_modules / gauge / node_modules / has-unicode / test / index.js
1 "use strict"
2 var test = require("tap").test
3 var requireInject = require("require-inject")
4
5 test("Windows", function (t) {
6   t.plan(1)
7   var hasUnicode = requireInject("../index.js", {
8     os: { type: function () { return "Windows_NT" } }
9   })
10   t.is(hasUnicode(), false, "Windows is assumed NOT to be unicode aware")
11 })
12 test("Unix Env", function (t) {
13   t.plan(3)
14   var hasUnicode = requireInject("../index.js", {
15     os: { type: function () { return "Linux" } },
16     child_process: { exec: function (cmd,cb) { cb(new Error("not available")) } }
17   })
18   process.env.LANG = "en_US.UTF-8"
19   process.env.LC_ALL = null
20   t.is(hasUnicode(), true, "Linux with a UTF8 language")
21   process.env.LANG = null
22   process.env.LC_ALL = "en_US.UTF-8"
23   t.is(hasUnicode(), true, "Linux with UTF8 locale")
24   process.env.LC_ALL = null
25   t.is(hasUnicode(), false, "Linux without UTF8 language or locale")
26 })