XDebuggerAssertions: Add missing assertVariableTypeMatches overloads

GitOrigin-RevId: 4c81b8d2f1c3ff73cd8a6a06c89d06a54f361ded
This commit is contained in:
Eldar Abusalimov
2019-10-01 21:12:59 +00:00
committed by intellij-monorepo-bot
parent e12eece974
commit 5f5cf4e666
@@ -248,17 +248,33 @@ public class XDebuggerAssertions extends XDebuggerTestUtil {
public static void assertVariableTypeMatches(@NotNull XValue var,
@Nullable String name,
@Nullable @Language("RegExp") String typePattern) {
assertVariableTypeMatches(var, name, typePattern, XDebuggerTestUtil::waitFor);
assertVariableTypeMatches(var, name, typePattern, null);
}
public static void assertVariableTypeMatches(@NotNull XValue var,
@Nullable String name,
@Nullable @Language("RegExp") String typePattern,
@Nullable String value) {
assertVariableTypeMatches(var, name, typePattern, value, null);
}
public static void assertVariableTypeMatches(@NotNull XValue var,
@Nullable String name,
@Nullable @Language("RegExp") String typePattern,
@Nullable String value,
@Nullable Boolean hasChildren) {
assertVariableTypeMatches(var, name, typePattern, value, hasChildren, null, XDebuggerTestUtil::waitFor);
}
public static void assertVariableTypeMatches(@NotNull XValue var,
@Nullable String name,
@Nullable @Language("RegExp") String typePattern,
@Nullable String value,
@Nullable Boolean hasChildren,
@Nullable Icon icon,
@NotNull BiFunction<Semaphore, Long, Boolean> waitFunction) {
XTestValueNode node = computePresentation(var, waitFunction);
if (name != null) {
assertEquals(name, node.myName);
}
assertVariable(node, name, null, value, hasChildren, icon);
if (typePattern != null) {
assertTrue("Expected type: " + typePattern + " Actual type: " + node.myType,
node.myType != null && node.myType.matches(typePattern));