[Pkg-javascript-commits] [node-unicode-loose-match] 05/06: Add some testing
Bastien Roucariès
rouca at moszumanska.debian.org
Fri Sep 8 15:03:10 UTC 2017
This is an automated email from the git hooks/post-receive script.
rouca pushed a commit to branch master
in repository node-unicode-loose-match.
commit 216ac9a3af399e9b3a9c7da6b2a69df3ebb8377f
Author: Bastien ROUCARIÈS <roucaries.bastien at gmail.com>
Date: Fri Sep 8 16:58:03 2017 +0200
Add some testing
---
debian/control | 4 +++-
debian/install | 2 +-
debian/rules | 23 +++++++++++++++++++++--
debian/smoketest.js | 19 +++++++++++++++++++
4 files changed, 44 insertions(+), 4 deletions(-)
diff --git a/debian/control b/debian/control
index 20dd1d1..aedb221 100644
--- a/debian/control
+++ b/debian/control
@@ -4,10 +4,12 @@ Priority: optional
Maintainer: Debian Javascript Maintainers <pkg-javascript-devel at lists.alioth.debian.org>
Uploaders: Julien Puydt <julien.puydt at laposte.net>
Build-Depends: debhelper (>= 10),
+ dpkg-dev (>= 1.18.8)
node-jsesc (>= 2.2.0),
node-unicode-property-aliases (>= 1.1.0),
node-unicode-property-value-aliases (>=1.2.1),
- nodejs
+ node-lodash (>= 4.0) <!nocheck>,
+ nodejs (>= 6.11.2~)
Standards-Version: 4.1.0
Homepage: https://github.com/mathiasbynens/unicode-loose-match
Vcs-Git: https://anonscm.debian.org/git/pkg-javascript/node-unicode-loose-match.git
diff --git a/debian/install b/debian/install
index 1537656..1502f97 100644
--- a/debian/install
+++ b/debian/install
@@ -1,3 +1,3 @@
package.json usr/lib/nodejs/unicode-loose-match/
dist/data usr/lib/nodejs/unicode-loose-match/
-index.js usr/lib/nodejs/unicode-loose-match/
+dist/index.js usr/lib/nodejs/unicode-loose-match/
diff --git a/debian/rules b/debian/rules
index e0a83f5..ed463ec 100755
--- a/debian/rules
+++ b/debian/rules
@@ -3,18 +3,37 @@
%:
dh $@
+override_dh_auto_configure:
+ #npm install unicode-property-aliases unicode-property-value-aliases unicode-10.0.0
+
dist/scripts/build.js: scripts/build.js
mkdir -p "$(dir $@)"
sed -E -e "s,require[(]'unicode-([[:digit:]]+([.])?)+'[)],require('../../debian/BinaryProperty'),g" "$<" > "$@"
+ #sed -E -e "s,require[(]'unicode-([[:digit:]]+([.])?)+'[)],require('unicode-10.0.0'),g" "$<" > "$@"
dist/data/mapping.js: dist/scripts/build.js
mkdir -p "$(dir $@)"
(cd dist && node scripts/build.js)
+dist/index.js: index.js
+ mkdir -p "$(dir $@)"
+ cp -f "$<" "$@"
+
+override_dh_auto_build: dist/index.js dist/data/mapping.js
+
+dist/scripts/smoketest.js: debian/smoketest.js
+ mkdir -p "$(dir $@)"
+ cp -f "$<" "$@"
-override_dh_auto_build: dist/data/mapping.js
+ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS) $(DEB_BUILD_PROFILES)))
+override_dh_auto_test: dist/scripts/smoketest.js
+ node "dist/scripts/smoketest.js"
+else
+override_dh_auto_test:
+endif
override_dh_auto_clean:
rm -rf dist
- dh_auto_clean
\ No newline at end of file
+ rm -rf node_modules
+ dh_auto_clean
diff --git a/debian/smoketest.js b/debian/smoketest.js
new file mode 100644
index 0000000..b4ae632
--- /dev/null
+++ b/debian/smoketest.js
@@ -0,0 +1,19 @@
+'use strict';
+try {
+ const matchLoosely = require('..');
+ const lodash = require('lodash');
+ var blk=matchLoosely('blk', 'Arabic_PF_B');
+ console.log(blk);
+ if(lodash.isEqual(blk,{ property: 'Block', value: 'Arabic_Presentation_Forms_B' }))
+ process.exit(0);
+ else {
+ process.stderr.write('not equal');
+ process.exit(1);
+ }
+}
+catch(e) {
+ process.stderr.write(e);
+ process.exit(2);
+}
+
+
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/node-unicode-loose-match.git
More information about the Pkg-javascript-commits
mailing list