[Pkg-javascript-commits] [node-ansi-regex] 03/03: new upstream release + tests
Paolo Greppi
paolog-guest at moszumanska.debian.org
Tue Sep 19 07:44:37 UTC 2017
This is an automated email from the git hooks/post-receive script.
paolog-guest pushed a commit to branch master
in repository node-ansi-regex.
commit 87c9950f51aaab173c8fe92c3ff1c72ba49e067e
Author: Paolo Greppi <paolo.greppi at libpf.com>
Date: Tue Sep 19 09:42:03 2017 +0200
new upstream release + tests
---
debian/changelog | 8 ++++
debian/control | 7 ++-
debian/patches/00-mocha.diff | 106 +++++++++++++++++++++++++++++++++++++++++++
debian/patches/series | 1 +
debian/tests/control | 3 ++
5 files changed, 123 insertions(+), 2 deletions(-)
diff --git a/debian/changelog b/debian/changelog
index 6e48790..3697a0a 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,11 @@
+node-ansi-regex (3.0.0-1) UNRELEASED; urgency=medium
+
+ * New upstream release
+ * Bump standards version
+ * Run tests
+
+ -- Paolo Greppi <paolo.greppi at libpf.com> Tue, 19 Sep 2017 09:30:04 +0200
+
node-ansi-regex (2.0.0-1) unstable; urgency=medium
* Initial release
diff --git a/debian/control b/debian/control
index 23fe3e6..a126616 100644
--- a/debian/control
+++ b/debian/control
@@ -2,12 +2,15 @@ Source: node-ansi-regex
Section: web
Priority: optional
Maintainer: Debian Javascript Maintainers <pkg-javascript-devel at lists.alioth.debian.org>
-Uploaders: Thorsten Alteholz <debian at alteholz.de>
+Uploaders:
+ Thorsten Alteholz <debian at alteholz.de>
+ Paolo Greppi <paolo.greppi at libpf.com>
Build-Depends:
debhelper (>= 9)
, dh-buildinfo
+ , mocha
, nodejs
-Standards-Version: 3.9.7
+Standards-Version: 4.0.1
Homepage: https://github.com/sindresorhus/ansi-regex
Vcs-Git: https://anonscm.debian.org/git/pkg-javascript/node-ansi-regex.git
Vcs-Browser: https://anonscm.debian.org/cgit/pkg-javascript/node-ansi-regex.git
diff --git a/debian/patches/00-mocha.diff b/debian/patches/00-mocha.diff
new file mode 100644
index 0000000..5c369b8
--- /dev/null
+++ b/debian/patches/00-mocha.diff
@@ -0,0 +1,106 @@
+Index: node-ansi-regex/test.js
+===================================================================
+--- node-ansi-regex.orig/test.js
++++ node-ansi-regex/test.js
+@@ -1,40 +1,40 @@
+-import test from 'ava';
+-import ansiCodes from './fixtures/ansi-codes';
+-import m from '.';
++var ansiCodes = require('./fixtures/ansi-codes');
++var m = require('.');
++var assert = require('assert');
+
+ const consumptionChars = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ!@#$%^&*()_+1234567890-=[]{};\':"./>?,<\\|';
+
+ // Testing against codes found at: http://ascii-table.com/ansi-escape-sequences-vt-100.php
+-test('match ansi code in a string', t => {
+- t.regex('foo\u001B[4mcake\u001B[0m', m());
+- t.regex('\u001B[4mcake\u001B[0m', m());
+- t.regex('foo\u001B[4mcake\u001B[0m', m());
+- t.regex('\u001B[0m\u001B[4m\u001B[42m\u001B[31mfoo\u001B[39m\u001B[49m\u001B[24mfoo\u001B[0m', m());
+- t.regex('foo\u001B[mfoo', m());
++test('match ansi code in a string', function() {
++ assert(m().test('foo\u001B[4mcake\u001B[0m'));
++ assert(m().test('\u001B[4mcake\u001B[0m'));
++ assert(m().test('foo\u001B[4mcake\u001B[0m'));
++ assert(m().test('\u001B[0m\u001B[4m\u001B[42m\u001B[31mfoo\u001B[39m\u001B[49m\u001B[24mfoo\u001B[0m'));
++ assert(m().test('foo\u001B[mfoo'));
+ });
+
+-test('match ansi code from ls command', t => {
+- t.regex('\u001B[00;38;5;244m\u001B[m\u001B[00;38;5;33mfoo\u001B[0m', m());
++test('match ansi code from ls command', function() {
++ assert(m().test('\u001B[00;38;5;244m\u001B[m\u001B[00;38;5;33mfoo\u001B[0m'));
+ });
+
+-test('match reset;setfg;setbg;italics;strike;underline sequence in a string', t => {
+- t.regex('\u001B[0;33;49;3;9;4mbar\u001B[0m', m());
+- t.is('foo\u001B[0;33;49;3;9;4mbar'.match(m())[0], '\u001B[0;33;49;3;9;4m');
++test('match reset;setfg;setbg;italics;strike;underline sequence in a string', function() {
++ assert(m().test('\u001B[0;33;49;3;9;4mbar\u001B[0m'));
++ assert('foo\u001B[0;33;49;3;9;4mbar'.match(m())[0] === '\u001B[0;33;49;3;9;4m');
+ });
+
+-test('match clear tabs sequence in a string', t => {
+- t.regex('foo\u001B[0gbar', m());
+- t.is('foo\u001B[0gbar'.match(m())[0], '\u001B[0g');
++test('match clear tabs sequence in a string', function() {
++ assert(m().test('foo\u001B[0gbar'));
++ assert('foo\u001B[0gbar'.match(m())[0] === '\u001B[0g');
+ });
+
+-test('match clear line from cursor right in a string', t => {
+- t.regex('foo\u001B[Kbar', m());
+- t.is('foo\u001B[Kbar'.match(m())[0], '\u001B[K');
++test('match clear line from cursor right in a string', function() {
++ assert(m().test('foo\u001B[Kbar'));
++ assert('foo\u001B[Kbar'.match(m())[0] === '\u001B[K');
+ });
+
+-test('match clear screen in a string', t => {
+- t.regex('foo\u001B[2Jbar', m());
+- t.is('foo\u001B[2Jbar'.match(m())[0], '\u001B[2J');
++test('match clear screen in a string', function() {
++ assert(m().test('foo\u001B[2Jbar'));
++ assert('foo\u001B[2Jbar'.match(m())[0] === '\u001B[2J');
+ });
+
+ // Testing against extended codes (excluding codes ending in 0-9)
+@@ -46,19 +46,19 @@ for (const codeSet of Object.keys(ansiCo
+ const skipText = skip ? '[SKIP] ' : '';
+ const ecode = `\u001B${code}`;
+
+- test(`${skipText}${code} → ${codeInfo[0]}`, t => {
++ test(`${skipText}${code} → ${codeInfo[0]}`, function() {
+ if (skip) {
+ t.pass();
+ return;
+ }
+
+ const string = `hel${ecode}lo`;
+- t.regex(string, m());
+- t.is(string.match(m())[0], ecode);
+- t.is(string.replace(m(), ''), 'hello');
++ assert(m().test(string));
++ assert(string.match(m())[0] == ecode);
++ assert(string.replace(m(), '') === 'hello');
+ });
+
+- test(`${skipText}${code} should not overconsume`, t => {
++ test(`${skipText}${code} should not overconsume`, function() {
+ if (skip) {
+ t.pass();
+ return;
+@@ -66,9 +66,9 @@ for (const codeSet of Object.keys(ansiCo
+
+ for (const c of consumptionChars) {
+ const string = ecode + c;
+- t.regex(string, m());
+- t.is(string.match(m())[0], ecode);
+- t.is(string.replace(m(), ''), c);
++ assert(m().test(string));
++ assert(string.match(m())[0] == ecode);
++ assert(string.replace(m(), '') === c);
+ }
+ });
+ }
diff --git a/debian/patches/series b/debian/patches/series
new file mode 100644
index 0000000..c508ffd
--- /dev/null
+++ b/debian/patches/series
@@ -0,0 +1 @@
+00-mocha.diff
diff --git a/debian/tests/control b/debian/tests/control
index adf227c..61c09ff 100644
--- a/debian/tests/control
+++ b/debian/tests/control
@@ -1,2 +1,5 @@
Tests: require
Depends: node-ansi-regex
+
+Test-Command: mocha -u tdd
+Depends: @, @builddeps@
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/node-ansi-regex.git
More information about the Pkg-javascript-commits
mailing list