diff options
author | Forrest L Norvell <forrest@npmjs.com> | 2014-08-29 04:53:50 +0400 |
---|---|---|
committer | Forrest L Norvell <forrest@npmjs.com> | 2014-08-29 04:53:50 +0400 |
commit | b2f51aecadf585711e145b6516f99e7c05f53614 (patch) | |
tree | f54e59cba3383b813dde439144d3854b30ffc460 /node_modules/semver/test | |
parent | 1d041a8a5ebd5bf6cecafab2072d4ec07823adab (diff) |
semver@3.0.1
semver.clean() is now cleaner.
Diffstat (limited to 'node_modules/semver/test')
-rw-r--r-- | node_modules/semver/test/clean.js | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/node_modules/semver/test/clean.js b/node_modules/semver/test/clean.js new file mode 100644 index 000000000..1ab13e416 --- /dev/null +++ b/node_modules/semver/test/clean.js @@ -0,0 +1,25 @@ +var tap = require('tap'); +var test = tap.test; +var semver = require('../semver.js'); +var clean = semver.clean; + +test('\nclean tests', function(t) { + // [range, version] + // Version should be detectable despite extra characters + [ + ['1.2.3', '1.2.3'], + [' 1.2.3 ', '1.2.3'], + [' 1.2.3-4 ', '1.2.3-4'], + [' 1.2.3-pre ', '1.2.3-pre'], + [' =v1.2.3 ', '1.2.3'], + ['v1.2.3', '1.2.3'], + [' v1.2.3 ', '1.2.3'], + ['\t1.2.3', '1.2.3'] + ].forEach(function(tuple) { + var range = tuple[0]; + var version = tuple[1]; + var msg = 'clean(' + range + ') = ' + version; + t.equal(clean(range), version, msg); + }); + t.end(); +}); |