]> gerrit.simantics Code Review - simantics/district.git/blob - 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
1 global.FAKE_WINDOWS = true
2
3 var rps = require('../index.js')
4 var test = require("tap").test
5 var path = require("path")
6
7 var cases = {
8   "C:\\x\\y\\z": {
9     raw: 'C:\\x\\y\\z',
10     scope: null,
11     name: null,
12     rawSpec: 'C:\\x\\y\\z',
13     spec: path.resolve('C:\\x\\y\\z'),
14     type: 'local'
15   },
16   "foo@C:\\x\\y\\z": {
17     raw: 'foo@C:\\x\\y\\z',
18     scope: null,
19     name: 'foo',
20     rawSpec: 'C:\\x\\y\\z',
21     spec: path.resolve('C:\\x\\y\\z'),
22     type: 'local'
23   },
24   "foo@/foo/bar/baz": {
25     raw: 'foo@/foo/bar/baz',
26     scope: null,
27     name: 'foo',
28     rawSpec: '/foo/bar/baz',
29     spec: path.resolve('/foo/bar/baz'),
30     type: 'local'
31   }
32 }
33
34 test("parse a windows path", function (t) {
35   t.plan( Object.keys(cases).length )
36   Object.keys(cases).forEach(function (c) {
37     var expect = cases[c]
38     rps(c, function(err, actual) {
39       t.same(actual, expect, c)
40     })
41   })
42 })