aboutsummaryrefslogtreecommitdiff
path: root/test/run-tests.js
diff options
context:
space:
mode:
authoralexlamsl <alexlamsl@gmail.com>2017-02-18 19:15:09 +0800
committeralexlamsl <alexlamsl@gmail.com>2017-02-21 13:29:58 +0800
commitc525a2b1907fdef36acffdeea4cf02ae476d8399 (patch)
tree5c13410ee82d400e658f5d8404ab12d3528d60d4 /test/run-tests.js
parent6ffbecb72b515d6e9e6dee1f76d8f27e4b014854 (diff)
downloadtracifyjs-c525a2b1907fdef36acffdeea4cf02ae476d8399.tar.gz
tracifyjs-c525a2b1907fdef36acffdeea4cf02ae476d8399.zip
fix duplicated test names
previously test cases with the same name would be skipped except for the last one `test/run-test.js` will now report duplicated names as errors closes #1461
Diffstat (limited to 'test/run-tests.js')
-rwxr-xr-xtest/run-tests.js3
1 files changed, 3 insertions, 0 deletions
diff --git a/test/run-tests.js b/test/run-tests.js
index a4721399..15a12c6b 100755
--- a/test/run-tests.js
+++ b/test/run-tests.js
@@ -194,6 +194,9 @@ function parse_test(file) {
if (node instanceof U.AST_LabeledStatement
&& tw.parent() instanceof U.AST_Toplevel) {
var name = node.label.name;
+ if (name in tests) {
+ throw new Error('Duplicated test name "' + name + '" in ' + file);
+ }
tests[name] = get_one_test(name, node.body);
return true;
}