Skip to content

Instantly share code, notes, and snippets.

@431824
Last active March 29, 2017 09:33
Show Gist options
  • Save 431824/a2f63ae9181c0104e66df7fe17641994 to your computer and use it in GitHub Desktop.
Save 431824/a2f63ae9181c0104e66df7fe17641994 to your computer and use it in GitHub Desktop.
CodingStyle: divide assert from logic (GTW)
#Before
@Test
public void myTest() {
Foo foo = new Foo();
test.apply(foo);
assertEquals(BigInteger.ONE, test.result());
}
#After
@Test
public void myTest() {
Foo foo = new Foo();
test.apply(foo);
assertEquals(BigInteger.ONE, test.result());
}
Find: (^((?!assert).)*)\n([\s]{1,})assert
ReplaceWith: $1\n\n$3assert
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment