~~ lineWidth: 40 ~~
== should print ==
while (true) {
    a;
    b;
}

[expect]
while (true) {
    a;
    b;
}

== should print multi-line ==
while (thisIsA && veryLongHeader && that) {
    a;
    b;
}

[expect]
while (
    thisIsA && veryLongHeader && that
) {
    a;
    b;
}

== should print multi-line when exceeding width twice ==
while (thisIsA && veryLongHeader && thatWillExceedTwice) {
    a;
    b;
}

[expect]
while (
    thisIsA && veryLongHeader
    && thatWillExceedTwice
) {
    a;
    b;
}

== should use multiple lines if open paren is on a different line than condition ==
while (
    true) {
    }

[expect]
while (
    true
) {
}

== should print empty while statement on same line when on same line ==
while (true) {}

[expect]
while (true) {}

== should print empty while statement on different line when close brace on different line ==
while (true) {
}

[expect]
while (true) {
}

== should handle empty with comments ==
while (true) { /* 1 */ }
while (true) {
/* test */}
while (true) { // 1
//2
/* 3*/}

[expect]
while (true) { /* 1 */ }
while (true) {
    /* test */
}
while (true) { // 1
    // 2
    /* 3*/
}

== should handle block comment on first line with statement ==
while (true) { /* 1 */
s;}
while (true) { /* 1 */ s; /* 2 */}

[expect]
while (true) {
    /* 1 */
    s;
}
while (true) /* 1 */ s; /* 2 */

== should print when only has an empty statement ==
while (true);

[expect]
while (true);

== should print when only has an empty statement on next line ==
while (true)
    ;

[expect]
while (true);

== should support comments in header ==
while (
    // testing
    test
) {
    a;
}

[expect]
while (
    // testing
    test
) {
    a;
}

== should move trailing header comment to next line ==
while (// testing
    test
) {
    a;
}

[expect]
while (
    // testing
    test
) {
    a;
}
