| 40 columns | |
| >>> Unsplit assert initializers. |
| class Foo { |
| Foo() : assert(1), assert(2); |
| } |
| <<< |
| class Foo { |
| Foo() : assert(1), assert(2); |
| } |
| >>> Split assert initializers. |
| class Foo { |
| Foo(parameter, another) : assert(condition, 'some long message'), |
| assert(cond), |
| assert(anotherCondition, 'another message'); |
| } |
| <<< |
| class Foo { |
| Foo(parameter, another) |
| : assert( |
| condition, |
| 'some long message', |
| ), |
| assert(cond), |
| assert( |
| anotherCondition, |
| 'another message', |
| ); |
| } |
| >>> Split in assert forces initializers to split. |
| class Foo { |
| Foo() : assert( |
| veryLongConditionExpression); |
| } |
| <<< |
| class Foo { |
| Foo() |
| : assert( |
| veryLongConditionExpression, |
| ); |
| } |
| >>> Align split assert argument lists past the `:`. |
| class Foo { |
| Foo(parameter1, parameter2, parameter3) |
| : assert(condition, 'some long assert message'), |
| assert(anotherLongCondition, 'a message'); |
| } |
| <<< |
| class Foo { |
| Foo( |
| parameter1, |
| parameter2, |
| parameter3, |
| ) : assert( |
| condition, |
| 'some long assert message', |
| ), |
| assert( |
| anotherLongCondition, |
| 'a message', |
| ); |
| } |
| >>> Align split assert argument lists past the `:`. |
| class Foo { |
| Foo(parameter1, [parameter2, parameter3]) |
| : assert(condition, 'some long assert message'), |
| assert(anotherLongCondition, 'a message'); |
| } |
| <<< |
| class Foo { |
| Foo( |
| parameter1, [ |
| parameter2, |
| parameter3, |
| ]) : assert( |
| condition, |
| 'some long assert message', |
| ), |
| assert( |
| anotherLongCondition, |
| 'a message', |
| ); |
| } |
| >>> Allow block-formatting the assert arguments. |
| class Foo { |
| Foo() |
| : assert( |
| () { |
| slowComputation(); |
| }(), |
| ); |
| } |
| <<< |
| class Foo { |
| Foo() |
| : assert(() { |
| slowComputation(); |
| }()); |
| } |