The data contained in this repository can be downloaded to your computer using one of several clients.
Please see the documentation of your version control software client for more information.

Please select the desired protocol below to get the URL.

This URL has Read-Only access.

Statistics
| Branch: | Revision:

main_repo / deps / npm / node_modules / semver / test.js @ 5aef65a9

History | View | Annotate | Download (12.4 KB)

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", "1.0.0"]
175
  , [">= 1", "1.0.0"]
176
  , ["<1.2", "1.1.1"]
177
  , ["< 1.2", "1.1.1"]
178
  , ["1", "1.0.0beta"]
179
  , ["~v0.5.4-pre", "0.5.5"]
180
  , ["~v0.5.4-pre", "0.5.4"]
181
  , ["=0.7.x", "0.7.2"]
182
  , [">=0.7.x", "0.7.2"]
183
  , ["=0.7.x", "0.7.0-asdf"]
184
  , [">=0.7.x", "0.7.0-asdf"]
185
  , ["<=0.7.x", "0.6.2"]
186
  , ["~1.2.1 >=1.2.3", "1.2.3"]
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', '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']
192
  , ['>=1.2.1 1.2.3', '1.2.3']
193
  , ['1.2.3 >=1.2.1', '1.2.3']
194
  , ['>=1.2.3 >=1.2.1', '1.2.3']
195
  , ['>=1.2.1 >=1.2.3', '1.2.3']
196
  ].forEach(function (v) {
197
    t.ok(satisfies(v[1], v[0]), v[0]+" satisfied by "+v[1])
198
  })
199
  t.end()
200
})
201

    
202
test("\nnegative range tests", function (t) {
203
// [range, version]
204
// version should not be included by range
205
; [ ["1.0.0 - 2.0.0", "2.2.3"]
206
  , ["1.0.0", "1.0.1"]
207
  , [">=1.0.0", "0.0.0"]
208
  , [">=1.0.0", "0.0.1"]
209
  , [">=1.0.0", "0.1.0"]
210
  , [">1.0.0", "0.0.1"]
211
  , [">1.0.0", "0.1.0"]
212
  , ["<=2.0.0", "3.0.0"]
213
  , ["<=2.0.0", "2.9999.9999"]
214
  , ["<=2.0.0", "2.2.9"]
215
  , ["<2.0.0", "2.9999.9999"]
216
  , ["<2.0.0", "2.2.9"]
217
  , [">=0.1.97", "v0.1.93"]
218
  , [">=0.1.97", "0.1.93"]
219
  , ["0.1.20 || 1.2.4", "1.2.3"]
220
  , [">=0.2.3 || <0.0.1", "0.0.3"]
221
  , [">=0.2.3 || <0.0.1", "0.2.2"]
222
  , ["2.x.x", "1.1.3"]
223
  , ["2.x.x", "3.1.3"]
224
  , ["1.2.x", "1.3.3"]
225
  , ["1.2.x || 2.x", "3.1.3"]
226
  , ["1.2.x || 2.x", "1.1.3"]
227
  , ["2.*.*", "1.1.3"]
228
  , ["2.*.*", "3.1.3"]
229
  , ["1.2.*", "1.3.3"]
230
  , ["1.2.* || 2.*", "3.1.3"]
231
  , ["1.2.* || 2.*", "1.1.3"]
232
  , ["2", "1.1.2"]
233
  , ["2.3", "2.4.1"]
234
  , ["~2.4", "2.5.0"] // >=2.4.0 <2.5.0
235
  , ["~2.4", "2.3.9"]
236
  , ["~>3.2.1", "3.3.2"] // >=3.2.1 <3.3.0
237
  , ["~>3.2.1", "3.2.0"] // >=3.2.1 <3.3.0
238
  , ["~1", "0.2.3"] // >=1.0.0 <2.0.0
239
  , ["~>1", "2.2.3"]
240
  , ["~1.0", "1.1.0"] // >=1.0.0 <1.1.0
241
  , ["<1", "1.0.0"]
242
  , [">=1.2", "1.1.1"]
243
  , ["1", "2.0.0beta"]
244
  , ["~v0.5.4-beta", "0.5.4-alpha"]
245
  , ["<1", "1.0.0beta"]
246
  , ["< 1", "1.0.0beta"]
247
  , ["=0.7.x", "0.8.2"]
248
  , [">=0.7.x", "0.6.2"]
249
  , ["<=0.7.x", "0.7.2"]
250
  ].forEach(function (v) {
251
    t.ok(!satisfies(v[1], v[0]), v[0]+" not satisfied by "+v[1])
252
  })
253
  t.end()
254
})
255

    
256
test("\nincrement versions test", function (t) {
257
// [version, inc, result]
258
// inc(version, inc) -> result
259
; [ [ "1.2.3",   "major", "2.0.0"   ]
260
  , [ "1.2.3",   "minor", "1.3.0"   ]
261
  , [ "1.2.3",   "patch", "1.2.4"   ]
262
  , [ "1.2.3",   "build", "1.2.3-1" ]
263
  , [ "1.2.3-4", "build", "1.2.3-5" ]
264
  , [ "1.2.3tag",    "major", "2.0.0"   ]
265
  , [ "1.2.3-tag",   "major", "2.0.0"   ]
266
  , [ "1.2.3tag",    "build", "1.2.3-1" ]
267
  , [ "1.2.3-tag",   "build", "1.2.3-1" ]
268
  , [ "1.2.3-4-tag", "build", "1.2.3-5" ]
269
  , [ "1.2.3-4tag",  "build", "1.2.3-5" ]
270
  , [ "1.2.3", "fake",  null ]
271
  , [ "fake",  "major", null ]
272
  ].forEach(function (v) {
273
    t.equal(inc(v[0], v[1]), v[2], "inc("+v[0]+", "+v[1]+") === "+v[2])
274
  })
275

    
276
  t.end()
277
})
278

    
279
test("\nreplace stars test", function (t) {
280
// replace stars with ""
281
; [ [ "", "" ]
282
  , [ "*", "" ]
283
  , [ "> *", "" ]
284
  , [ "<*", "" ]
285
  , [ " >=  *", "" ]
286
  , [ "* || 1.2.3", " || 1.2.3" ]
287
  ].forEach(function (v) {
288
    t.equal(replaceStars(v[0]), v[1], "replaceStars("+v[0]+") === "+v[1])
289
  })
290

    
291
  t.end()
292
})
293

    
294
test("\nvalid range test", function (t) {
295
// [range, result]
296
// validRange(range) -> result
297
// translate ranges into their canonical form
298
; [ ["1.0.0 - 2.0.0", ">=1.0.0 <=2.0.0"]
299
  , ["1.0.0", "1.0.0"]
300
  , [">=*", ""]
301
  , ["", ""]
302
  , ["*", ""]
303
  , ["*", ""]
304
  , [">=1.0.0", ">=1.0.0"]
305
  , [">1.0.0", ">1.0.0"]
306
  , ["<=2.0.0", "<=2.0.0"]
307
  , ["1", ">=1.0.0- <2.0.0-"]
308
  , ["<=2.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
  , [">= 1.0.0", ">=1.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
  , ["<=   2.0.0", "<=2.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
  , [">=0.1.97", ">=0.1.97"]
323
  , [">=0.1.97", ">=0.1.97"]
324
  , ["0.1.20 || 1.2.4", "0.1.20||1.2.4"]
325
  , [">=0.2.3 || <0.0.1", ">=0.2.3||<0.0.1"]
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
  , ["||", "||"]
329
  , ["2.x.x", ">=2.0.0- <3.0.0-"]
330
  , ["1.2.x", ">=1.2.0- <1.3.0-"]
331
  , ["1.2.x || 2.x", ">=1.2.0- <1.3.0-||>=2.0.0- <3.0.0-"]
332
  , ["1.2.x || 2.x", ">=1.2.0- <1.3.0-||>=2.0.0- <3.0.0-"]
333
  , ["x", ""]
334
  , ["2.*.*", null]
335
  , ["1.2.*", null]
336
  , ["1.2.* || 2.*", null]
337
  , ["1.2.* || 2.*", null]
338
  , ["*", ""]
339
  , ["2", ">=2.0.0- <3.0.0-"]
340
  , ["2.3", ">=2.3.0- <2.4.0-"]
341
  , ["~2.4", ">=2.4.0- <2.5.0-"]
342
  , ["~2.4", ">=2.4.0- <2.5.0-"]
343
  , ["~>3.2.1", ">=3.2.1- <3.3.0-"]
344
  , ["~1", ">=1.0.0- <2.0.0-"]
345
  , ["~>1", ">=1.0.0- <2.0.0-"]
346
  , ["~> 1", ">=1.0.0- <2.0.0-"]
347
  , ["~1.0", ">=1.0.0- <1.1.0-"]
348
  , ["~ 1.0", ">=1.0.0- <1.1.0-"]
349
  , ["<1", "<1.0.0-"]
350
  , ["< 1", "<1.0.0-"]
351
  , [">=1", ">=1.0.0-"]
352
  , [">= 1", ">=1.0.0-"]
353
  , ["<1.2", "<1.2.0-"]
354
  , ["< 1.2", "<1.2.0-"]
355
  , ["1", ">=1.0.0- <2.0.0-"]
356
  ].forEach(function (v) {
357
    t.equal(validRange(v[0]), v[1], "validRange("+v[0]+") === "+v[1])
358
  })
359

    
360
  t.end()
361
})
362

    
363
test("\ncomparators test", function (t) {
364
// [range, comparators]
365
// turn range into a set of individual comparators
366
; [ ["1.0.0 - 2.0.0", [[">=1.0.0", "<=2.0.0"]] ]
367
  , ["1.0.0", [["1.0.0"]] ]
368
  , [">=*", [[">=0.0.0-"]] ]
369
  , ["", [[""]]]
370
  , ["*", [[""]] ]
371
  , ["*", [[""]] ]
372
  , [">=1.0.0", [[">=1.0.0"]] ]
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
  , ["<=2.0.0", [["<=2.0.0"]] ]
378
  , ["1", [[">=1.0.0-", "<2.0.0-"]] ]
379
  , ["<=2.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
  , [">= 1.0.0", [[">=1.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
  , ["<=   2.0.0", [["<=2.0.0"]] ]
389
  , ["<= 2.0.0", [["<=2.0.0"]] ]
390
  , ["<=  2.0.0", [["<=2.0.0"]] ]
391
  , ["<    2.0.0", [["<2.0.0"]] ]
392
  , ["<\t2.0.0", [["<2.0.0"]] ]
393
  , [">=0.1.97", [[">=0.1.97"]] ]
394
  , [">=0.1.97", [[">=0.1.97"]] ]
395
  , ["0.1.20 || 1.2.4", [["0.1.20"], ["1.2.4"]] ]
396
  , [">=0.2.3 || <0.0.1", [[">=0.2.3"], ["<0.0.1"]] ]
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
  , ["||", [[""], [""]] ]
400
  , ["2.x.x", [[">=2.0.0-", "<3.0.0-"]] ]
401
  , ["1.2.x", [[">=1.2.0-", "<1.3.0-"]] ]
402
  , ["1.2.x || 2.x", [[">=1.2.0-", "<1.3.0-"], [">=2.0.0-", "<3.0.0-"]] ]
403
  , ["1.2.x || 2.x", [[">=1.2.0-", "<1.3.0-"], [">=2.0.0-", "<3.0.0-"]] ]
404
  , ["x", [[""]] ]
405
  , ["2.*.*", [[">=2.0.0-", "<3.0.0-"]] ]
406
  , ["1.2.*", [[">=1.2.0-", "<1.3.0-"]] ]
407
  , ["1.2.* || 2.*", [[">=1.2.0-", "<1.3.0-"], [">=2.0.0-", "<3.0.0-"]] ]
408
  , ["1.2.* || 2.*", [[">=1.2.0-", "<1.3.0-"], [">=2.0.0-", "<3.0.0-"]] ]
409
  , ["*", [[""]] ]
410
  , ["2", [[">=2.0.0-", "<3.0.0-"]] ]
411
  , ["2.3", [[">=2.3.0-", "<2.4.0-"]] ]
412
  , ["~2.4", [[">=2.4.0-", "<2.5.0-"]] ]
413
  , ["~2.4", [[">=2.4.0-", "<2.5.0-"]] ]
414
  , ["~>3.2.1", [[">=3.2.1-", "<3.3.0-"]] ]
415
  , ["~1", [[">=1.0.0-", "<2.0.0-"]] ]
416
  , ["~>1", [[">=1.0.0-", "<2.0.0-"]] ]
417
  , ["~> 1", [[">=1.0.0-", "<2.0.0-"]] ]
418
  , ["~1.0", [[">=1.0.0-", "<1.1.0-"]] ]
419
  , ["~ 1.0", [[">=1.0.0-", "<1.1.0-"]] ]
420
  , ["<1", [["<1.0.0-"]] ]
421
  , ["< 1", [["<1.0.0-"]] ]
422
  , [">=1", [[">=1.0.0-"]] ]
423
  , [">= 1", [[">=1.0.0-"]] ]
424
  , ["<1.2", [["<1.2.0-"]] ]
425
  , ["< 1.2", [["<1.2.0-"]] ]
426
  , ["1", [[">=1.0.0-", "<2.0.0-"]] ]
427
  , ["1 2", [[">=1.0.0-", "<2.0.0-", ">=2.0.0-", "<3.0.0-"]] ]
428
  ].forEach(function (v) {
429
    t.equivalent(toComparators(v[0]), v[1], "toComparators("+v[0]+") === "+JSON.stringify(v[1]))
430
  })
431

    
432
  t.end()
433
})