PageRenderTime 18ms CodeModel.GetById 13ms app.highlight 2ms RepoModel.GetById 2ms app.codeStats 0ms

/node_modules/minimatch/test/caching.js

https://bitbucket.org/coleman333/smartsite
JavaScript | 14 lines | 13 code | 0 blank | 1 comment | 1 complexity | a21947bdad9ab0904db4fe403832866b MD5 | raw file
 1var Minimatch = require("../minimatch.js").Minimatch
 2var tap = require("tap")
 3tap.test("cache test", function (t) {
 4  var mm1 = new Minimatch("a?b")
 5  var mm2 = new Minimatch("a?b")
 6  t.equal(mm1, mm2, "should get the same object")
 7  // the lru should drop it after 100 entries
 8  for (var i = 0; i < 100; i ++) {
 9    new Minimatch("a"+i)
10  }
11  mm2 = new Minimatch("a?b")
12  t.notEqual(mm1, mm2, "cache should have dropped")
13  t.end()
14})