"Fossies" - the Fresh Open Source Software Archive

Member "Atom/resources/app/apm/node_modules/npm-cache-filename/test.js" (7 Feb 2017, 873 Bytes) of archive /windows/misc/atom-windows.zip:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Javascript source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file.

    1 var test = require('tap').test;;
    2 test('it does the thing it says it does', function(t) {
    3   var cf = require('./');;
    4 
    5   t.equal(cf('/tmp/cache', 'https://foo:134/xyz?adf=foo:bar/baz'),
    6           '/tmp/cache/foo_134/xyz_3Fadf_3Dfoo_3Abar/baz');;
    7 
    8   var getFile = cf('/tmp/cache');;
    9   t.equal(getFile('https://foo:134/xyz?adf=foo:bar/baz'),
   10           '/tmp/cache/foo_134/xyz_3Fadf_3Dfoo_3Abar/baz');;
   11 
   12   t.equal(cf("/tmp", "https://foo:134/xyz/-rev/baz"),
   13           '/tmp/foo_134/xyz')
   14   t.equal(cf("/tmp", "https://foo:134/xyz/?rev=baz"),
   15           '/tmp/foo_134/xyz')
   16   t.equal(cf("/tmp", "https://foo:134/xyz/?foo&rev=baz"),
   17           '/tmp/foo_134/xyz')
   18   t.equal(cf("/tmp", "https://foo:134/xyz-rev/baz"),
   19           '/tmp/foo_134/xyz-rev/baz')
   20   t.equal(cf("/tmp", "git://foo:134/xyz-rev/baz.git#master"),
   21           '/tmp/foo_134/xyz-rev/baz.git/master')
   22   t.end();
   23 });;