]> gerrit.simantics Code Review - simantics/district.git/blobdiff - org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/realize-package-specifier/test/npa-windows.js
Adding integrated tile server
[simantics/district.git] / org.simantics.maps.server / node / node-v4.8.0-win-x64 / node_modules / npm / node_modules / realize-package-specifier / test / npa-windows.js
diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/realize-package-specifier/test/npa-windows.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/realize-package-specifier/test/npa-windows.js
new file mode 100644 (file)
index 0000000..f6275be
--- /dev/null
@@ -0,0 +1,42 @@
+global.FAKE_WINDOWS = true
+
+var rps = require('../index.js')
+var test = require("tap").test
+var path = require("path")
+
+var cases = {
+  "C:\\x\\y\\z": {
+    raw: 'C:\\x\\y\\z',
+    scope: null,
+    name: null,
+    rawSpec: 'C:\\x\\y\\z',
+    spec: path.resolve('C:\\x\\y\\z'),
+    type: 'local'
+  },
+  "foo@C:\\x\\y\\z": {
+    raw: 'foo@C:\\x\\y\\z',
+    scope: null,
+    name: 'foo',
+    rawSpec: 'C:\\x\\y\\z',
+    spec: path.resolve('C:\\x\\y\\z'),
+    type: 'local'
+  },
+  "foo@/foo/bar/baz": {
+    raw: 'foo@/foo/bar/baz',
+    scope: null,
+    name: 'foo',
+    rawSpec: '/foo/bar/baz',
+    spec: path.resolve('/foo/bar/baz'),
+    type: 'local'
+  }
+}
+
+test("parse a windows path", function (t) {
+  t.plan( Object.keys(cases).length )
+  Object.keys(cases).forEach(function (c) {
+    var expect = cases[c]
+    rps(c, function(err, actual) {
+      t.same(actual, expect, c)
+    })
+  })
+})