~~ lineWidth: 30 ~~ == should format == test? 1: 2; [expect] test ? 1 : 2; == should convert to newlines when the first condition goes over the line width == testingThisOutHereAgain ? test2 : test; [expect] testingThisOutHereAgain ? test2 : test; == should convert to newlines when the second condition goes over the line width == testingThis ? test2 : testingThis; [expect] testingThis ? test2 : testingThis; == should not use newlines when the first and second start on the same line, but the second goes onto multiple lines == test ? test : a.b(m => { return 5; }); [expect] test ? test : a.b(m => { return 5; }); == should handle multi-line nested conditionals == test ? testtttt : test ? 3 : 4; [expect] test ? testtttt : test ? 3 : 4; == should handle single line nested conditionals == test ? 1 : test ? 3 : 46666666; [expect] test ? 1 : test ? 3 : 46666666; == should handle single line nested conditionals that exceed line width twice == test ? 1 : test ? 3 : 466666666666666666666; [expect] test ? 1 : test ? 3 : 466666666666666666666; == additional nested condition test (from Deno's code) == function test() { return c === 0x30 /* 0 */ ? "\x00" : c === 0x61 /* a */ ? "\x07" : c === 0x62 /* b */ ? "\x08" : ""; } [expect] function test() { return c === 0x30 /* 0 */ ? "\x00" : c === 0x61 /* a */ ? "\x07" : c === 0x62 /* b */ ? "\x08" : ""; } == should handle nested conditionals with the nested conditional being after the question mark == test ? 1 : test ? 3 ? 5555555555555555555555555555 : 44444444444444 : 4; [expect] test ? 1 : test ? 3 ? 5555555555555555555555555555 : 44444444444444 : 4; == should handle when the semi-colon falls exactly on the line width == test ? testingThis : outABittt; [expect] test ? testingThis : outABittt; == should handle comments == /* 0 */ testingtesting /* 1 */ /* 2 */ ? /* 3 */ asdfasdf /* 4 */ /* 5 */ : /* 6 */ asdfasdfasdf /* 7 */; /* 8 */ [expect] /* 0 */ testingtesting /* 1 */ /* 2 */ ? /* 3 */ asdfasdf /* 4 */ /* 5 */ : /* 6 */ asdfasdfasdf /* 7 */; /* 8 */