Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/npm/cli.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'node_modules/minimatch/test/caching.js')
-rw-r--r--node_modules/minimatch/test/caching.js14
1 files changed, 14 insertions, 0 deletions
diff --git a/node_modules/minimatch/test/caching.js b/node_modules/minimatch/test/caching.js
new file mode 100644
index 000000000..0fec4b0fa
--- /dev/null
+++ b/node_modules/minimatch/test/caching.js
@@ -0,0 +1,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()
+})