diff options
author | alexlamsl <alexlamsl@gmail.com> | 2017-02-18 19:15:09 +0800 |
---|---|---|
committer | alexlamsl <alexlamsl@gmail.com> | 2017-02-21 13:29:58 +0800 |
commit | c525a2b1907fdef36acffdeea4cf02ae476d8399 (patch) | |
tree | 5c13410ee82d400e658f5d8404ab12d3528d60d4 /test/run-tests.js | |
parent | 6ffbecb72b515d6e9e6dee1f76d8f27e4b014854 (diff) | |
download | tracifyjs-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-x | test/run-tests.js | 3 |
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; } |