aboutsummaryrefslogtreecommitdiff
path: root/tools/blog/node_modules/glob/node_modules/minimatch/test/caching.js
blob: 0fec4b0fad0bf8587d9b9c6ad4e4a1c51ccf57d0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
var Minimatch = require("../minimatch.js").Minimatch
var tap = require("tap")
tap.test("cache test", function (t) {
  var mm1 = new Minimatch("a?b")
  var mm2 = new Minimatch("a?b")
  t.equal(mm1, mm2, "should get the same object")
  // the lru should drop it after 100 entries
  for (var i = 0; i < 100; i ++) {
    new Minimatch("a"+i)
  }
  mm2 = new Minimatch("a?b")
  t.notEqual(mm1, mm2, "cache should have dropped")
  t.end()
})