Name: js-handler/node_modules/restify/node_modules/semver/test.js 
1:
var tap = require("tap")
2:
  , test = tap.test
3:
  , semver = require("./semver.js")
4:
  , eq = semver.eq
5:
  , gt = semver.gt
6:
  , lt = semver.lt
7:
  , neq = semver.neq
8:
  , cmp = semver.cmp
9:
  , gte = semver.gte
10:
  , lte = semver.lte
11:
  , satisfies = semver.satisfies
12:
  , validRange = semver.validRange
13:
  , inc = semver.inc
14:
  , replaceStars = semver.replaceStars
15:
  , toComparators = semver.toComparators
16:
 
17:
tap.plan(8)
18:
 
19:
test("\ncomparison tests", function (t) {
20:
// [version1, version2]
21:
// version1 should be greater than version2
22:
; [ ["0.0.0", "0.0.0foo"]
23:
  , ["0.0.1", "0.0.0"]
24:
  , ["1.0.0", "0.9.9"]
25:
  , ["0.10.0", "0.9.0"]
26:
  , ["0.99.0", "0.10.0"]
27:
  , ["2.0.0", "1.2.3"]
28:
  , ["v0.0.0", "0.0.0foo"]
29:
  , ["v0.0.1", "0.0.0"]
30:
  , ["v1.0.0", "0.9.9"]
31:
  , ["v0.10.0", "0.9.0"]
32:
  , ["v0.99.0", "0.10.0"]
33:
  , ["v2.0.0", "1.2.3"]
34:
  , ["0.0.0", "v0.0.0foo"]
35:
  , ["0.0.1", "v0.0.0"]
36:
  , ["1.0.0", "v0.9.9"]
37:
  , ["0.10.0", "v0.9.0"]
38:
  , ["0.99.0", "v0.10.0"]
39:
  , ["2.0.0", "v1.2.3"]
40:
  , ["1.2.3", "1.2.3-asdf"]
41:
  , ["1.2.3-4", "1.2.3"]
42:
  , ["1.2.3-4-foo", "1.2.3"]
43:
  , ["1.2.3-5", "1.2.3-5-foo"]
44:
  , ["1.2.3-5", "1.2.3-4"]
45:
  , ["1.2.3-5-foo", "1.2.3-5-Foo"]
46:
  , ["3.0.0", "2.7.2+"]
47:
  ].forEach(function (v) {
48:
    var v0 = v[0]
49:
      , v1 = v[1]
50:
    t.ok(gt(v0, v1), "gt('"+v0+"', '"+v1+"')")
51:
    t.ok(lt(v1, v0), "lt('"+v1+"', '"+v0+"')")
52:
    t.ok(!gt(v1, v0), "!gt('"+v1+"', '"+v0+"')")
53:
    t.ok(!lt(v0, v1), "!lt('"+v0+"', '"+v1+"')")
54:
    t.ok(eq(v0, v0), "eq('"+v0+"', '"+v0+"')")
55:
    t.ok(eq(v1, v1), "eq('"+v1+"', '"+v1+"')")
56:
    t.ok(neq(v0, v1), "neq('"+v0+"', '"+v1+"')")
57:
    t.ok(cmp(v1, "==", v1), "cmp('"+v1+"' == '"+v1+"')")
58:
    t.ok(cmp(v0, ">=", v1), "cmp('"+v0+"' >= '"+v1+"')")
59:
    t.ok(cmp(v1, "<=", v0), "cmp('"+v1+"' <= '"+v0+"')")
60:
    t.ok(cmp(v0, "!=", v1), "cmp('"+v0+"' != '"+v1+"')")
61:
  })
62:
  t.end()
63:
})
64:
 
65:
test("\nequality tests", function (t) {
66:
// [version1, version2]
67:
// version1 should be equivalent to version2
68:
; [ ["1.2.3", "v1.2.3"]
69:
  , ["1.2.3", "=1.2.3"]
70:
  , ["1.2.3", "v 1.2.3"]
71:
  , ["1.2.3", "= 1.2.3"]
72:
  , ["1.2.3", " v1.2.3"]
73:
  , ["1.2.3", " =1.2.3"]
74:
  , ["1.2.3", " v 1.2.3"]
75:
  , ["1.2.3", " = 1.2.3"]
76:
  , ["1.2.3-0", "v1.2.3-0"]
77:
  , ["1.2.3-0", "=1.2.3-0"]
78:
  , ["1.2.3-0", "v 1.2.3-0"]
79:
  , ["1.2.3-0", "= 1.2.3-0"]
80:
  , ["1.2.3-0", " v1.2.3-0"]
81:
  , ["1.2.3-0", " =1.2.3-0"]
82:
  , ["1.2.3-0", " v 1.2.3-0"]
83:
  , ["1.2.3-0", " = 1.2.3-0"]
84:
  , ["1.2.3-01", "v1.2.3-1"]
85:
  , ["1.2.3-01", "=1.2.3-1"]
86:
  , ["1.2.3-01", "v 1.2.3-1"]
87:
  , ["1.2.3-01", "= 1.2.3-1"]
88:
  , ["1.2.3-01", " v1.2.3-1"]
89:
  , ["1.2.3-01", " =1.2.3-1"]
90:
  , ["1.2.3-01", " v 1.2.3-1"]
91:
  , ["1.2.3-01", " = 1.2.3-1"]
92:
  , ["1.2.3beta", "v1.2.3beta"]
93:
  , ["1.2.3beta", "=1.2.3beta"]
94:
  , ["1.2.3beta", "v 1.2.3beta"]
95:
  , ["1.2.3beta", "= 1.2.3beta"]
96:
  , ["1.2.3beta", " v1.2.3beta"]
97:
  , ["1.2.3beta", " =1.2.3beta"]
98:
  , ["1.2.3beta", " v 1.2.3beta"]
99:
  , ["1.2.3beta", " = 1.2.3beta"]
100:
  ].forEach(function (v) {
101:
    var v0 = v[0]
102:
      , v1 = v[1]
103:
    t.ok(eq(v0, v1), "eq('"+v0+"', '"+v1+"')")
104:
    t.ok(!neq(v0, v1), "!neq('"+v0+"', '"+v1+"')")
105:
    t.ok(cmp(v0, "==", v1), "cmp("+v0+"=="+v1+")")
106:
    t.ok(!cmp(v0, "!=", v1), "!cmp("+v0+"!="+v1+")")
107:
    t.ok(!cmp(v0, "===", v1), "!cmp("+v0+"==="+v1+")")
108:
    t.ok(cmp(v0, "!==", v1), "cmp("+v0+"!=="+v1+")")
109:
    t.ok(!gt(v0, v1), "!gt('"+v0+"', '"+v1+"')")
110:
    t.ok(gte(v0, v1), "gte('"+v0+"', '"+v1+"')")
111:
    t.ok(!lt(v0, v1), "!lt('"+v0+"', '"+v1+"')")
112:
    t.ok(lte(v0, v1), "lte('"+v0+"', '"+v1+"')")
113:
  })
114:
  t.end()
115:
})
116:
 
117:
 
118:
test("\nrange tests", function (t) {
119:
// [range, version]
120:
// version should be included by range
121:
; [ ["1.0.0 - 2.0.0", "1.2.3"]
122:
  , ["1.0.0", "1.0.0"]
123:
  , [">=*", "0.2.4"]
124:
  , ["", "1.0.0"]
125:
  , ["*", "1.2.3"]
126:
  , ["*", "v1.2.3-foo"]
127:
  , [">=1.0.0", "1.0.0"]
128:
  , [">=1.0.0", "1.0.1"]
129:
  , [">=1.0.0", "1.1.0"]
130:
  , [">1.0.0", "1.0.1"]
131:
  , [">1.0.0", "1.1.0"]
132:
  , ["<=2.0.0", "2.0.0"]
133:
  , ["<=2.0.0", "1.9999.9999"]
134:
  , ["<=2.0.0", "0.2.9"]
135:
  , ["<2.0.0", "1.9999.9999"]
136:
  , ["<2.0.0", "0.2.9"]
137:
  , [">= 1.0.0", "1.0.0"]
138:
  , [">=  1.0.0", "1.0.1"]
139:
  , [">=   1.0.0", "1.1.0"]
140:
  , ["> 1.0.0", "1.0.1"]
141:
  , [">  1.0.0", "1.1.0"]
142:
  , ["<=   2.0.0", "2.0.0"]
143:
  , ["<= 2.0.0", "1.9999.9999"]
144:
  , ["<=  2.0.0", "0.2.9"]
145:
  , ["<    2.0.0", "1.9999.9999"]
146:
  , ["<\t2.0.0", "0.2.9"]
147:
  , [">=0.1.97", "v0.1.97"]
148:
  , [">=0.1.97", "0.1.97"]
149:
  , ["0.1.20 || 1.2.4", "1.2.4"]
150:
  , [">=0.2.3 || <0.0.1", "0.0.0"]
151:
  , [">=0.2.3 || <0.0.1", "0.2.3"]
152:
  , [">=0.2.3 || <0.0.1", "0.2.4"]
153:
  , ["||", "1.3.4"]
154:
  , ["2.x.x", "2.1.3"]
155:
  , ["1.2.x", "1.2.3"]
156:
  , ["1.2.x || 2.x", "2.1.3"]
157:
  , ["1.2.x || 2.x", "1.2.3"]
158:
  , ["x", "1.2.3"]
159:
  , ["2.*.*", "2.1.3"]
160:
  , ["1.2.*", "1.2.3"]
161:
  , ["1.2.* || 2.*", "2.1.3"]
162:
  , ["1.2.* || 2.*", "1.2.3"]
163:
  , ["*", "1.2.3"]
164:
  , ["2", "2.1.2"]
165:
  , ["2.3", "2.3.1"]
166:
  , ["~2.4", "2.4.0"] // >=2.4.0 <2.5.0
167:
  , ["~2.4", "2.4.5"]
168:
  , ["~>3.2.1", "3.2.2"] // >=3.2.1 <3.3.0
169:
  , ["~1", "1.2.3"] // >=1.0.0 <2.0.0
170:
  , ["~>1", "1.2.3"]
171:
  , ["~> 1", "1.2.3"]
172:
  , ["~1.0", "1.0.2"] // >=1.0.0 <1.1.0
173:
  , ["~ 1.0", "1.0.2"]
174:
  , ["~ 1.0.3", "1.0.12"]
175:
  , [">=1", "1.0.0"]
176:
  , [">= 1", "1.0.0"]
177:
  , ["<1.2", "1.1.1"]
178:
  , ["< 1.2", "1.1.1"]
179:
  , ["1", "1.0.0beta"]
180:
  , ["~v0.5.4-pre", "0.5.5"]
181:
  , ["~v0.5.4-pre", "0.5.4"]
182:
  , ["=0.7.x", "0.7.2"]
183:
  , [">=0.7.x", "0.7.2"]
184:
  , ["=0.7.x", "0.7.0-asdf"]
185:
  , [">=0.7.x", "0.7.0-asdf"]
186:
  , ["<=0.7.x", "0.6.2"]
187:
  , ["~1.2.1 >=1.2.3", "1.2.3"]
188:
  , ["~1.2.1 =1.2.3", "1.2.3"]
189:
  , ["~1.2.1 1.2.3", "1.2.3"]
190:
  , ['~1.2.1 >=1.2.3 1.2.3', '1.2.3']
191:
  , ['~1.2.1 1.2.3 >=1.2.3', '1.2.3']
192:
  , ['~1.2.1 1.2.3', '1.2.3']
193:
  , ['>=1.2.1 1.2.3', '1.2.3']
194:
  , ['1.2.3 >=1.2.1', '1.2.3']
195:
  , ['>=1.2.3 >=1.2.1', '1.2.3']
196:
  , ['>=1.2.1 >=1.2.3', '1.2.3']
197:
  ].forEach(function (v) {
198:
    t.ok(satisfies(v[1], v[0]), v[0]+" satisfied by "+v[1])
199:
  })
200:
  t.end()
201:
})
202:
 
203:
test("\nnegative range tests", function (t) {
204:
// [range, version]
205:
// version should not be included by range
206:
; [ ["1.0.0 - 2.0.0", "2.2.3"]
207:
  , ["1.0.0", "1.0.1"]
208:
  , [">=1.0.0", "0.0.0"]
209:
  , [">=1.0.0", "0.0.1"]
210:
  , [">=1.0.0", "0.1.0"]
211:
  , [">1.0.0", "0.0.1"]
212:
  , [">1.0.0", "0.1.0"]
213:
  , ["<=2.0.0", "3.0.0"]
214:
  , ["<=2.0.0", "2.9999.9999"]
215:
  , ["<=2.0.0", "2.2.9"]
216:
  , ["<2.0.0", "2.9999.9999"]
217:
  , ["<2.0.0", "2.2.9"]
218:
  , [">=0.1.97", "v0.1.93"]
219:
  , [">=0.1.97", "0.1.93"]
220:
  , ["0.1.20 || 1.2.4", "1.2.3"]
221:
  , [">=0.2.3 || <0.0.1", "0.0.3"]
222:
  , [">=0.2.3 || <0.0.1", "0.2.2"]
223:
  , ["2.x.x", "1.1.3"]
224:
  , ["2.x.x", "3.1.3"]
225:
  , ["1.2.x", "1.3.3"]
226:
  , ["1.2.x || 2.x", "3.1.3"]
227:
  , ["1.2.x || 2.x", "1.1.3"]
228:
  , ["2.*.*", "1.1.3"]
229:
  , ["2.*.*", "3.1.3"]
230:
  , ["1.2.*", "1.3.3"]
231:
  , ["1.2.* || 2.*", "3.1.3"]
232:
  , ["1.2.* || 2.*", "1.1.3"]
233:
  , ["2", "1.1.2"]
234:
  , ["2.3", "2.4.1"]
235:
  , ["~2.4", "2.5.0"] // >=2.4.0 <2.5.0
236:
  , ["~2.4", "2.3.9"]
237:
  , ["~>3.2.1", "3.3.2"] // >=3.2.1 <3.3.0
238:
  , ["~>3.2.1", "3.2.0"] // >=3.2.1 <3.3.0
239:
  , ["~1", "0.2.3"] // >=1.0.0 <2.0.0
240:
  , ["~>1", "2.2.3"]
241:
  , ["~1.0", "1.1.0"] // >=1.0.0 <1.1.0
242:
  , ["<1", "1.0.0"]
243:
  , [">=1.2", "1.1.1"]
244:
  , ["1", "2.0.0beta"]
245:
  , ["~v0.5.4-beta", "0.5.4-alpha"]
246:
  , ["<1", "1.0.0beta"]
247:
  , ["< 1", "1.0.0beta"]
248:
  , ["=0.7.x", "0.8.2"]
249:
  , [">=0.7.x", "0.6.2"]
250:
  , ["<=0.7.x", "0.7.2"]
251:
  ].forEach(function (v) {
252:
    t.ok(!satisfies(v[1], v[0]), v[0]+" not satisfied by "+v[1])
253:
  })
254:
  t.end()
255:
})
256:
 
257:
test("\nincrement versions test", function (t) {
258:
// [version, inc, result]
259:
// inc(version, inc) -> result
260:
; [ [ "1.2.3",   "major", "2.0.0"   ]
261:
  , [ "1.2.3",   "minor", "1.3.0"   ]
262:
  , [ "1.2.3",   "patch", "1.2.4"   ]
263:
  , [ "1.2.3",   "build", "1.2.3-1" ]
264:
  , [ "1.2.3-4", "build", "1.2.3-5" ]
265:
  , [ "1.2.3tag",    "major", "2.0.0"   ]
266:
  , [ "1.2.3-tag",   "major", "2.0.0"   ]
267:
  , [ "1.2.3tag",    "build", "1.2.3-1" ]
268:
  , [ "1.2.3-tag",   "build", "1.2.3-1" ]
269:
  , [ "1.2.3-4-tag", "build", "1.2.3-5" ]
270:
  , [ "1.2.3-4tag",  "build", "1.2.3-5" ]
271:
  , [ "1.2.3", "fake",  null ]
272:
  , [ "fake",  "major", null ]
273:
  ].forEach(function (v) {
274:
    t.equal(inc(v[0], v[1]), v[2], "inc("+v[0]+", "+v[1]+") === "+v[2])
275:
  })
276:
 
277:
  t.end()
278:
})
279:
 
280:
test("\nreplace stars test", function (t) {
281:
// replace stars with ""
282:
; [ [ "", "" ]
283:
  , [ "*", "" ]
284:
  , [ "> *", "" ]
285:
  , [ "<*", "" ]
286:
  , [ " >=  *", "" ]
287:
  , [ "* || 1.2.3", " || 1.2.3" ]
288:
  ].forEach(function (v) {
289:
    t.equal(replaceStars(v[0]), v[1], "replaceStars("+v[0]+") === "+v[1])
290:
  })
291:
 
292:
  t.end()
293:
})
294:
 
295:
test("\nvalid range test", function (t) {
296:
// [range, result]
297:
// validRange(range) -> result
298:
// translate ranges into their canonical form
299:
; [ ["1.0.0 - 2.0.0", ">=1.0.0 <=2.0.0"]
300:
  , ["1.0.0", "1.0.0"]
301:
  , [">=*", ""]
302:
  , ["", ""]
303:
  , ["*", ""]
304:
  , ["*", ""]
305:
  , [">=1.0.0", ">=1.0.0"]
306:
  , [">1.0.0", ">1.0.0"]
307:
  , ["<=2.0.0", "<=2.0.0"]
308:
  , ["1", ">=1.0.0- <2.0.0-"]
309:
  , ["<=2.0.0", "<=2.0.0"]
310:
  , ["<=2.0.0", "<=2.0.0"]
311:
  , ["<2.0.0", "<2.0.0"]
312:
  , ["<2.0.0", "<2.0.0"]
313:
  , [">= 1.0.0", ">=1.0.0"]
314:
  , [">=  1.0.0", ">=1.0.0"]
315:
  , [">=   1.0.0", ">=1.0.0"]
316:
  , ["> 1.0.0", ">1.0.0"]
317:
  , [">  1.0.0", ">1.0.0"]
318:
  , ["<=   2.0.0", "<=2.0.0"]
319:
  , ["<= 2.0.0", "<=2.0.0"]
320:
  , ["<=  2.0.0", "<=2.0.0"]
321:
  , ["<    2.0.0", "<2.0.0"]
322:
  , ["<  2.0.0", "<2.0.0"]
323:
  , [">=0.1.97", ">=0.1.97"]
324:
  , [">=0.1.97", ">=0.1.97"]
325:
  , ["0.1.20 || 1.2.4", "0.1.20||1.2.4"]
326:
  , [">=0.2.3 || <0.0.1", ">=0.2.3||<0.0.1"]
327:
  , [">=0.2.3 || <0.0.1", ">=0.2.3||<0.0.1"]
328:
  , [">=0.2.3 || <0.0.1", ">=0.2.3||<0.0.1"]
329:
  , ["||", "||"]
330:
  , ["2.x.x", ">=2.0.0- <3.0.0-"]
331:
  , ["1.2.x", ">=1.2.0- <1.3.0-"]
332:
  , ["1.2.x || 2.x", ">=1.2.0- <1.3.0-||>=2.0.0- <3.0.0-"]
333:
  , ["1.2.x || 2.x", ">=1.2.0- <1.3.0-||>=2.0.0- <3.0.0-"]
334:
  , ["x", ""]
335:
  , ["2.*.*", null]
336:
  , ["1.2.*", null]
337:
  , ["1.2.* || 2.*", null]
338:
  , ["1.2.* || 2.*", null]
339:
  , ["*", ""]
340:
  , ["2", ">=2.0.0- <3.0.0-"]
341:
  , ["2.3", ">=2.3.0- <2.4.0-"]
342:
  , ["~2.4", ">=2.4.0- <2.5.0-"]
343:
  , ["~2.4", ">=2.4.0- <2.5.0-"]
344:
  , ["~>3.2.1", ">=3.2.1- <3.3.0-"]
345:
  , ["~1", ">=1.0.0- <2.0.0-"]
346:
  , ["~>1", ">=1.0.0- <2.0.0-"]
347:
  , ["~> 1", ">=1.0.0- <2.0.0-"]
348:
  , ["~1.0", ">=1.0.0- <1.1.0-"]
349:
  , ["~ 1.0", ">=1.0.0- <1.1.0-"]
350:
  , ["<1", "<1.0.0-"]
351:
  , ["< 1", "<1.0.0-"]
352:
  , [">=1", ">=1.0.0-"]
353:
  , [">= 1", ">=1.0.0-"]
354:
  , ["<1.2", "<1.2.0-"]
355:
  , ["< 1.2", "<1.2.0-"]
356:
  , ["1", ">=1.0.0- <2.0.0-"]
357:
  ].forEach(function (v) {
358:
    t.equal(validRange(v[0]), v[1], "validRange("+v[0]+") === "+v[1])
359:
  })
360:
 
361:
  t.end()
362:
})
363:
 
364:
test("\ncomparators test", function (t) {
365:
// [range, comparators]
366:
// turn range into a set of individual comparators
367:
; [ ["1.0.0 - 2.0.0", [[">=1.0.0", "<=2.0.0"]] ]
368:
  , ["1.0.0", [["1.0.0"]] ]
369:
  , [">=*", [[">=0.0.0-"]] ]
370:
  , ["", [[""]]]
371:
  , ["*", [[""]] ]
372:
  , ["*", [[""]] ]
373:
  , [">=1.0.0", [[">=1.0.0"]] ]
374:
  , [">=1.0.0", [[">=1.0.0"]] ]
375:
  , [">=1.0.0", [[">=1.0.0"]] ]
376:
  , [">1.0.0", [[">1.0.0"]] ]
377:
  , [">1.0.0", [[">1.0.0"]] ]
378:
  , ["<=2.0.0", [["<=2.0.0"]] ]
379:
  , ["1", [[">=1.0.0-", "<2.0.0-"]] ]
380:
  , ["<=2.0.0", [["<=2.0.0"]] ]
381:
  , ["<=2.0.0", [["<=2.0.0"]] ]
382:
  , ["<2.0.0", [["<2.0.0"]] ]
383:
  , ["<2.0.0", [["<2.0.0"]] ]
384:
  , [">= 1.0.0", [[">=1.0.0"]] ]
385:
  , [">=  1.0.0", [[">=1.0.0"]] ]
386:
  , [">=   1.0.0", [[">=1.0.0"]] ]
387:
  , ["> 1.0.0", [[">1.0.0"]] ]
388:
  , [">  1.0.0", [[">1.0.0"]] ]
389:
  , ["<=   2.0.0", [["<=2.0.0"]] ]
390:
  , ["<= 2.0.0", [["<=2.0.0"]] ]
391:
  , ["<=  2.0.0", [["<=2.0.0"]] ]
392:
  , ["<    2.0.0", [["<2.0.0"]] ]
393:
  , ["<\t2.0.0", [["<2.0.0"]] ]
394:
  , [">=0.1.97", [[">=0.1.97"]] ]
395:
  , [">=0.1.97", [[">=0.1.97"]] ]
396:
  , ["0.1.20 || 1.2.4", [["0.1.20"], ["1.2.4"]] ]
397:
  , [">=0.2.3 || <0.0.1", [[">=0.2.3"], ["<0.0.1"]] ]
398:
  , [">=0.2.3 || <0.0.1", [[">=0.2.3"], ["<0.0.1"]] ]
399:
  , [">=0.2.3 || <0.0.1", [[">=0.2.3"], ["<0.0.1"]] ]
400:
  , ["||", [[""], [""]] ]
401:
  , ["2.x.x", [[">=2.0.0-", "<3.0.0-"]] ]
402:
  , ["1.2.x", [[">=1.2.0-", "<1.3.0-"]] ]
403:
  , ["1.2.x || 2.x", [[">=1.2.0-", "<1.3.0-"], [">=2.0.0-", "<3.0.0-"]] ]
404:
  , ["1.2.x || 2.x", [[">=1.2.0-", "<1.3.0-"], [">=2.0.0-", "<3.0.0-"]] ]
405:
  , ["x", [[""]] ]
406:
  , ["2.*.*", [[">=2.0.0-", "<3.0.0-"]] ]
407:
  , ["1.2.*", [[">=1.2.0-", "<1.3.0-"]] ]
408:
  , ["1.2.* || 2.*", [[">=1.2.0-", "<1.3.0-"], [">=2.0.0-", "<3.0.0-"]] ]
409:
  , ["1.2.* || 2.*", [[">=1.2.0-", "<1.3.0-"], [">=2.0.0-", "<3.0.0-"]] ]
410:
  , ["*", [[""]] ]
411:
  , ["2", [[">=2.0.0-", "<3.0.0-"]] ]
412:
  , ["2.3", [[">=2.3.0-", "<2.4.0-"]] ]
413:
  , ["~2.4", [[">=2.4.0-", "<2.5.0-"]] ]
414:
  , ["~2.4", [[">=2.4.0-", "<2.5.0-"]] ]
415:
  , ["~>3.2.1", [[">=3.2.1-", "<3.3.0-"]] ]
416:
  , ["~1", [[">=1.0.0-", "<2.0.0-"]] ]
417:
  , ["~>1", [[">=1.0.0-", "<2.0.0-"]] ]
418:
  , ["~> 1", [[">=1.0.0-", "<2.0.0-"]] ]
419:
  , ["~1.0", [[">=1.0.0-", "<1.1.0-"]] ]
420:
  , ["~ 1.0", [[">=1.0.0-", "<1.1.0-"]] ]
421:
  , ["~ 1.0.3", [[">=1.0.3-", "<1.1.0-"]] ]
422:
  , ["~> 1.0.3", [[">=1.0.3-", "<1.1.0-"]] ]
423:
  , ["<1", [["<1.0.0-"]] ]
424:
  , ["< 1", [["<1.0.0-"]] ]
425:
  , [">=1", [[">=1.0.0-"]] ]
426:
  , [">= 1", [[">=1.0.0-"]] ]
427:
  , ["<1.2", [["<1.2.0-"]] ]
428:
  , ["< 1.2", [["<1.2.0-"]] ]
429:
  , ["1", [[">=1.0.0-", "<2.0.0-"]] ]
430:
  , ["1 2", [[">=1.0.0-", "<2.0.0-", ">=2.0.0-", "<3.0.0-"]] ]
431:
  ].forEach(function (v) {
432:
    t.equivalent(toComparators(v[0]), v[1], "toComparators("+v[0]+") === "+JSON.stringify(v[1]))
433:
  })
434:
 
435:
  t.end()
436:
})