]> gerrit.simantics Code Review - simantics/district.git/blobdiff - 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
diff --git a/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 b/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
new file mode 100644 (file)
index 0000000..cbdfda3
--- /dev/null
@@ -0,0 +1,26 @@
+"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")
+})