Comparing version 1.1.2 to 1.1.3
{ | ||
"name": "semver", | ||
"version": "1.1.2", | ||
"version": "1.1.3", | ||
"description": "The semantic version parser used by npm.", | ||
@@ -5,0 +5,0 @@ "main": "semver.js", |
@@ -87,3 +87,3 @@ ;(function (exports) { // nothing in here is node-specific. | ||
, starReplace = "" | ||
, compTrimExpression = new RegExp("((<|>)?=?)\\s*(" | ||
, compTrimExpression = new RegExp("((<|>)?=|<|>)\\s*(" | ||
+semver+"|"+xRangePlain+")", "g") | ||
@@ -153,3 +153,2 @@ , compTrimReplace = "$1$3" | ||
} | ||
//console.error("parseXRange", [].slice.call(arguments), ret) | ||
return ret | ||
@@ -156,0 +155,0 @@ }) |
27
test.js
@@ -20,2 +20,4 @@ var tap = require("tap") | ||
test("\ncomparison tests", function (t) { | ||
// [version1, version2] | ||
// version1 should be greater than version2 | ||
; [ ["0.0.0", "0.0.0foo"] | ||
@@ -65,2 +67,4 @@ , ["0.0.1", "0.0.0"] | ||
test("\nequality tests", function (t) { | ||
// [version1, version2] | ||
// version1 should be equivalent to version2 | ||
; [ ["1.2.3", "v1.2.3"] | ||
@@ -117,2 +121,4 @@ , ["1.2.3", "=1.2.3"] | ||
test("\nrange tests", function (t) { | ||
// [range, version] | ||
// version should be included by range | ||
; [ ["1.0.0 - 2.0.0", "1.2.3"] | ||
@@ -183,2 +189,12 @@ , ["1.0.0", "1.0.0"] | ||
, ["<=0.7.x", "0.6.2"] | ||
, ["~1.2.1 >=1.2.3", "1.2.3"] | ||
, ["~1.2.1 =1.2.3", "1.2.3"] | ||
, ["~1.2.1 1.2.3", "1.2.3"] | ||
, ['~1.2.1 >=1.2.3 1.2.3', '1.2.3'] | ||
, ['~1.2.1 1.2.3 >=1.2.3', '1.2.3'] | ||
, ['~1.2.1 1.2.3', '1.2.3'] | ||
, ['>=1.2.1 1.2.3', '1.2.3'] | ||
, ['1.2.3 >=1.2.1', '1.2.3'] | ||
, ['>=1.2.3 >=1.2.1', '1.2.3'] | ||
, ['>=1.2.1 >=1.2.3', '1.2.3'] | ||
].forEach(function (v) { | ||
@@ -191,2 +207,4 @@ t.ok(satisfies(v[1], v[0]), v[0]+" satisfied by "+v[1]) | ||
test("\nnegative range tests", function (t) { | ||
// [range, version] | ||
// version should not be included by range | ||
; [ ["1.0.0 - 2.0.0", "2.2.3"] | ||
@@ -244,2 +262,4 @@ , ["1.0.0", "1.0.1"] | ||
test("\nincrement versions test", function (t) { | ||
// [version, inc, result] | ||
// inc(version, inc) -> result | ||
; [ [ "1.2.3", "major", "2.0.0" ] | ||
@@ -266,2 +286,3 @@ , [ "1.2.3", "minor", "1.3.0" ] | ||
test("\nreplace stars test", function (t) { | ||
// replace stars with "" | ||
; [ [ "", "" ] | ||
@@ -281,2 +302,5 @@ , [ "*", "" ] | ||
test("\nvalid range test", function (t) { | ||
// [range, result] | ||
// validRange(range) -> result | ||
// translate ranges into their canonical form | ||
; [ ["1.0.0 - 2.0.0", ">=1.0.0 <=2.0.0"] | ||
@@ -348,2 +372,4 @@ , ["1.0.0", "1.0.0"] | ||
test("\ncomparators test", function (t) { | ||
// [range, comparators] | ||
// turn range into a set of individual comparators | ||
; [ ["1.0.0 - 2.0.0", [[">=1.0.0", "<=2.0.0"]] ] | ||
@@ -410,2 +436,3 @@ , ["1.0.0", [["1.0.0"]] ] | ||
, ["1", [[">=1.0.0-", "<2.0.0-"]] ] | ||
, ["1 2", [[">=1.0.0-", "<2.0.0-", ">=2.0.0-", "<3.0.0-"]] ] | ||
].forEach(function (v) { | ||
@@ -412,0 +439,0 @@ t.equivalent(toComparators(v[0]), v[1], "toComparators("+v[0]+") === "+JSON.stringify(v[1])) |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
29300
690