Skip to content

Commit 7cb6409

Browse files
committed
fix: drop the written 4th element IMPROVED_CASES no longer takes
Main's test split (#22825) replaced the explicit expected-output element with a snapshot; a 4-tuple entry breaks the array's declared 3-tuple type for every entry, not just its own.
1 parent 9aa89a2 commit 7cb6409

1 file changed

Lines changed: 4 additions & 8 deletions

File tree

‎test/unitCases/javascript/printer.unittest.js‎

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1817,26 +1817,22 @@ const IMPROVED_CASES = [
18171817
[
18181818
"an `if` returning early before a last `if` that returns, as one `if` of both tests, but where either has an `else`",
18191819
"function f(a, b) { if (a) return; if (b) return 1; } function g(a, b, c) { if (a) return; if (b) { if (c) return 2; } else console.log(3); } function h(a, b, c) { if (a) return; if (b) { if (c) return 4; else console.log(5); } } console.log(f(0, 0), f(0, 1), f(1, 1), g(0, 1, 1), g(0, 0, 0), g(1, 0, 0), h(0, 1, 1), h(0, 1, 0), h(1, 1, 0));",
1820-
{ compress: {}, mangle: false },
1821-
"function f(a,b){if(!a&&b)return 1}function g(a,b,c){if(!a)if(b){if(c)return 2}else console.log(3)}function h(a,b,c){if(!a&&b){if(c)return 4;console.log(5)}}console.log(f(0,0),f(0,1),f(1,1),g(0,1,1),g(0,0,0),g(1,0,0),h(0,1,1),h(0,1,0),h(1,1,0));"
1820+
{ compress: {}, mangle: false }
18221821
],
18231822
[
18241823
"a `let` before a loop assigning it first, given that value where it stands, but where the value reads it",
18251824
"function f(n) { let i; for (i = 0; i < n; i++); let j; for (j = () => j; i < 3; i++); return [i, typeof j]; } console.log(f(2));",
1826-
{ compress: { passes: 2 }, mangle: false },
1827-
"function f(n){let i=0,j;for(;i<n;i++);for(j=()=>j;i<3;i++);return[i,typeof j]}console.log(f(2));"
1825+
{ compress: { passes: 2 }, mangle: false }
18281826
],
18291827
[
18301828
"a template substituting a string a top-level `const` holds, which a quoted literal would print longer than",
18311829
'const o = "o", d = "d", l = "a string longer than the name"; var w = `w${o}r${d}s`, n = `w${`${o}r`}`, k = `<${l}>`; console.log(w, n, k);',
1832-
{ compress: { passes: 2 }, mangle: false },
1833-
'const o="o",d="d",l="a string longer than the name";var w="words",n="wor",k=`<${l}>`;console.log(w,n,k);'
1830+
{ compress: { passes: 2 }, mangle: false }
18341831
],
18351832
[
18361833
"a loop's update, its value unread, without what has no effects",
18371834
"function f(a, b, i) { for (i = 0; i < 3; 0, i++, 0) console.log(i); for (; a < 2; b++, 1) a++; return a; } console.log(f(0, 0));",
1838-
{ compress: { passes: 2 }, mangle: false },
1839-
"function f(a,b,i){for(i=0;i<3;i++)console.log(i);for(;a<2;)a++;return a}console.log(f(0,0));"
1835+
{ compress: { passes: 2 }, mangle: false }
18401836
],
18411837
[
18421838
"an `if` with an empty branch and an `else` block, as an `if` of the negated test, but a chain's",

0 commit comments

Comments
 (0)