[build-path-prefix-map-spec] 18/50: More test cases and behaviour standardisation
Ximin Luo
infinity0 at debian.org
Fri Mar 10 15:17:19 UTC 2017
This is an automated email from the git hooks/post-receive script.
infinity0 pushed a commit to branch master
in repository build-path-prefix-map-spec.
commit 7f3eb4e498f707e0754731ad3bbaf85308d664b9
Author: Ximin Luo <infinity0 at debian.org>
Date: Mon Jan 30 16:15:35 2017 +0100
More test cases and behaviour standardisation
---
consume/Makefile | 4 ++++
consume/pecsplit.js | 8 ++++----
consume/testcases/pecsplit.0.empty-ok.env | 2 +-
consume/testcases/pecsplit.0.plain-pc.env | 1 +
consume/testcases/pecsplit.0.plain-pc.in | 3 +++
consume/testcases/{0.basic.out => pecsplit.0.plain-pc.out} | 2 +-
consume/testcases/pecsplit.0.short-pc.env | 2 +-
consume/testcases/pecsplit.0.short-pc.in | 5 ++++-
consume/testcases/pecsplit.0.short-pc.out | 5 ++++-
9 files changed, 23 insertions(+), 9 deletions(-)
diff --git a/consume/Makefile b/consume/Makefile
index 2b91082..61ae99a 100644
--- a/consume/Makefile
+++ b/consume/Makefile
@@ -1,3 +1,7 @@
+# To add a new interpreted-language example, add it to ALLCHECK_pecsplit
+# To add a new compiled-language example, add the source to ALL_SOURCE, the
+# output to ALLCHECK_pecsplit, then add any relevant rules to compile it.
+
TMPDIR = /run/shm/rb-prefix-map
T = testcases/
diff --git a/consume/pecsplit.js b/consume/pecsplit.js
index ab22147..370284a 100755
--- a/consume/pecsplit.js
+++ b/consume/pecsplit.js
@@ -5,12 +5,12 @@ var unquote = function(x) {
};
var parse_prefix_map = function(x) {
- return x ? x.split(/:+/g).map(function(part) {
+ return (x || "").split(/:/g).filter(Boolean).map(function(part) {
var tuples = part.split(/=/g).map(unquote);
if (tuples.length !== 2) throw "invalid value: " + x;
return tuples;
- }) : [];
-}
+ });
+};
var map_prefix = function(string, pm) {
for (var i = pm.length - 1; i >= 0; --i) {;
@@ -21,7 +21,7 @@ var map_prefix = function(string, pm) {
}
}
return string;
-}
+};
var pm = parse_prefix_map(process.env["BUILD_PATH_PREFIX_MAP"]);
diff --git a/consume/testcases/pecsplit.0.empty-ok.env b/consume/testcases/pecsplit.0.empty-ok.env
index c4ad41b..c2505c1 100644
--- a/consume/testcases/pecsplit.0.empty-ok.env
+++ b/consume/testcases/pecsplit.0.empty-ok.env
@@ -1 +1 @@
-/a/b%+yyy=ERROR:/a=lol::/b=foo:/a/b%+yyy=secreteh
+:/a/b%+yyy=ERROR:/a=lol::/b=foo:/a/b%+yyy=secreteh:
diff --git a/consume/testcases/pecsplit.0.plain-pc.env b/consume/testcases/pecsplit.0.plain-pc.env
new file mode 100644
index 0000000..af03b7f
--- /dev/null
+++ b/consume/testcases/pecsplit.0.plain-pc.env
@@ -0,0 +1 @@
+/a/b%?yyy=ERROR:/a=lol:/b=foo:/a/b%?yyy=secrete%h
diff --git a/consume/testcases/pecsplit.0.plain-pc.in b/consume/testcases/pecsplit.0.plain-pc.in
new file mode 100644
index 0000000..eb23270
--- /dev/null
+++ b/consume/testcases/pecsplit.0.plain-pc.in
@@ -0,0 +1,3 @@
+/a/d
+/b/1234
+/a/b%?yyy/xxx
diff --git a/consume/testcases/0.basic.out b/consume/testcases/pecsplit.0.plain-pc.out
similarity index 51%
copy from consume/testcases/0.basic.out
copy to consume/testcases/pecsplit.0.plain-pc.out
index bca0b1d..ae70991 100644
--- a/consume/testcases/0.basic.out
+++ b/consume/testcases/pecsplit.0.plain-pc.out
@@ -1,3 +1,3 @@
lol/d
foo/1234
-secreteh/xxx
+secrete%h/xxx
diff --git a/consume/testcases/pecsplit.0.short-pc.env b/consume/testcases/pecsplit.0.short-pc.env
index 0f994d0..aabad14 100644
--- a/consume/testcases/pecsplit.0.short-pc.env
+++ b/consume/testcases/pecsplit.0.short-pc.env
@@ -1 +1 @@
-/a/b%+yyy=ERROR%:/a=lol:/b=foo:/a/b%+yyy=secreteh
+/a/b%+yyy=ERROR%:/a=lol%%%:/b%%=foo%%%%:/a/b%+yyy%=sec%;reteh
diff --git a/consume/testcases/pecsplit.0.short-pc.in b/consume/testcases/pecsplit.0.short-pc.in
deleted file mode 120000
index 997afa5..0000000
--- a/consume/testcases/pecsplit.0.short-pc.in
+++ /dev/null
@@ -1 +0,0 @@
-0.basic.in
\ No newline at end of file
diff --git a/consume/testcases/pecsplit.0.short-pc.in b/consume/testcases/pecsplit.0.short-pc.in
new file mode 100644
index 0000000..1d712d5
--- /dev/null
+++ b/consume/testcases/pecsplit.0.short-pc.in
@@ -0,0 +1,4 @@
+/a/d
+/b/1234
+/b%/1234
+/a/b=yyy%/xxx
diff --git a/consume/testcases/pecsplit.0.short-pc.out b/consume/testcases/pecsplit.0.short-pc.out
deleted file mode 120000
index 3d3fecb..0000000
--- a/consume/testcases/pecsplit.0.short-pc.out
+++ /dev/null
@@ -1 +0,0 @@
-0.basic.out
\ No newline at end of file
diff --git a/consume/testcases/pecsplit.0.short-pc.out b/consume/testcases/pecsplit.0.short-pc.out
new file mode 100644
index 0000000..1ea2a3c
--- /dev/null
+++ b/consume/testcases/pecsplit.0.short-pc.out
@@ -0,0 +1,4 @@
+lol%%/d
+/b/1234
+foo%%/1234
+sec:reteh/xxx
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/reproducible/build-path-prefix-map-spec.git
More information about the Reproducible-commits
mailing list