Fixed the test and added a second one

This commit is contained in:
Ozan Gulle
2019-11-19 20:25:50 +01:00
parent ef476a6e9e
commit c41dc3f5ab

View File

@ -576,13 +576,29 @@ public class Bar extends Foo {
}
]]></code>
</test-code>
<!--test-code>
<description>Predicates are treated like booleans</description>
<expected-problems>1</expected-problems>
<test-code>
<description>Predicate properties are treated like booleans</description>
<expected-problems>0</expected-problems>
<code><![CDATA[
import java.util.function.Predicate;
public class ClassWithPredicates {
public Predicate<String> isNotEmpty = string -> !string.isEmpty();
}
]]></code>
</test-code-->
</test-code>
<test-code>
<description>Predicate variables are treated like booleans</description>
<expected-problems>0</expected-problems>
<code><![CDATA[
import java.util.function.Predicate;
public class SomeClass {
public static void main(String[] args) {
Predicate<String> isEmpty = string -> string.isEmpty();
}
}
]]></code>
</test-code>
</test-data>