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
}\r
}\r
\r
-drop_console_1: {\r
+drop_console_2: {\r
options = { drop_console: true };\r
input: {\r
console.log('foo');\r
--- /dev/null
+statements: {
+ options = {
+ hoist_funs: false,
+ hoist_vars: true,
+ }
+ input: {
+ function f() {
+ var a = 1;
+ var b = 2;
+ var c = 3;
+ function g() {}
+ return g(a, b, c);
+ }
+ }
+ expect: {
+ function f() {
+ var a = 1, b = 2, c = 3;
+ function g() {}
+ return g(a, b, c);
+ }
+ }
+}
+
+statements_funs: {
+ options = {
+ hoist_funs: true,
+ hoist_vars: true,
+ }
+ input: {
+ function f() {
+ var a = 1;
+ var b = 2;
+ var c = 3;
+ function g() {}
+ return g(a, b, c);
+ }
+ }
+ expect: {
+ function f() {
+ function g() {}
+ var a = 1, b = 2, c = 3;
+ return g(a, b, c);
+ }
+ }
+}
+
+sequences: {
+ options = {
+ hoist_funs: false,
+ hoist_vars: true,
+ }
+ input: {
+ function f() {
+ var a = 1, b = 2;
+ function g() {}
+ var c = 3;
+ return g(a, b, c);
+ }
+ }
+ expect: {
+ function f() {
+ var c, a = 1, b = 2;
+ function g() {}
+ c = 3;
+ return g(a, b, c);
+ }
+ }
+}
+
+sequences_funs: {
+ options = {
+ hoist_funs: true,
+ hoist_vars: true,
+ }
+ input: {
+ function f() {
+ var a = 1, b = 2;
+ function g() {}
+ var c = 3;
+ return g(a, b, c);
+ }
+ }
+ expect: {
+ function f() {
+ function g() {}
+ var a = 1, b = 2, c = 3;
+ return g(a, b, c);
+ }
+ }
+}
}
}
-negate_iife_3: {
+negate_iife_4: {
options = {
negate_iife: true,
conditionals: true,
}
}
-negate_iife_4: {
+negate_iife_5: {
options = {
negate_iife: true,
sequences: true,
}
}
-negate_iife_4_off: {
+negate_iife_5_off: {
options = {
negate_iife: false,
sequences: true,
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;
}