[Pkg-javascript-commits] [node-minimatch] 10/14: Patch to run tests using old tap
Jérémy Lal
kapouer at moszumanska.debian.org
Thu Nov 3 23:36:02 UTC 2016
This is an automated email from the git hooks/post-receive script.
kapouer pushed a commit to branch master
in repository node-minimatch.
commit 39ada89e13e190c3e888bbf68489c7bed6102b4d
Author: Jérémy Lal <kapouer at melix.org>
Date: Fri Nov 4 00:31:30 2016 +0100
Patch to run tests using old tap
---
debian/patches/series | 1 +
debian/patches/test-tap.patch | 47 +++++++++++++++++++++++++++++++++++++++++++
2 files changed, 48 insertions(+)
diff --git a/debian/patches/series b/debian/patches/series
new file mode 100644
index 0000000..e839026
--- /dev/null
+++ b/debian/patches/series
@@ -0,0 +1 @@
+test-tap.patch
diff --git a/debian/patches/test-tap.patch b/debian/patches/test-tap.patch
new file mode 100644
index 0000000..b2e84db
--- /dev/null
+++ b/debian/patches/test-tap.patch
@@ -0,0 +1,47 @@
+Description: run tests with old tap version
+Author: Jérémy Lal <kapouer at melix.org>
+Last-Update: 2016-11-04
+Forwarded: not-needed
+--- a/test/redos.js
++++ b/test/redos.js
+@@ -1,4 +1,4 @@
+-var t = require('tap')
++var tap = require('tap')
+
+ var minimatch = require('../')
+
+@@ -14,15 +14,25 @@
+
+ var exploit = '!(' + genstr(1024 * 15, '\\') + 'A)'
+
+-// within the limits, and valid match
+-t.ok(minimatch('A', exploit))
++tap.test('redos tests', function(t) {
++ // within the limits, and valid match
++ t.ok(minimatch('A', exploit))
+
+-// within the limits, but results in an invalid regexp
+-exploit = '[!(' + genstr(1024 * 15, '\\') + 'A'
+-t.notOk(minimatch('A', exploit))
++ // within the limits, but results in an invalid regexp
++ exploit = '[!(' + genstr(1024 * 15, '\\') + 'A'
++ t.notOk(minimatch('A', exploit))
+
+-t.throws(function () {
++
++
+ // too long, throws TypeError
+- exploit = '!(' + genstr(1024 * 64, '\\') + 'A)'
+- minimatch('A', exploit)
+-}, TypeError)
++ var err;
++ try {
++ exploit = '!(' + genstr(1024 * 64, '\\') + 'A)'
++ minimatch('A', exploit)
++ } catch(ex) {
++ err = ex;
++ }
++ t.ok(err instanceof TypeError)
++
++ t.end()
++})
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/node-minimatch.git
More information about the Pkg-javascript-commits
mailing list