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
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user