don't blink with pure contract on gutter when starting to write a method

This commit is contained in:
peter
2014-09-15 14:49:58 +02:00
parent 2c20268f48
commit 8a71cfc404
2 changed files with 19 additions and 1 deletions
@@ -120,6 +120,15 @@ int smthPure() { return 3; }
"""
}
public void "test don't analyze methods without returns"() {
assertPure false, """
Object method() {
smthPure();
}
int smthPure() { return 3; }
"""
}
private void assertPure(boolean expected, String classBody) {
def clazz = myFixture.addClass("final class Foo { $classBody }")
assert expected == PurityInference.inferPurity(clazz.methods[0])