From 99bdd04fed32c81f630df24b13669e01ae51c9a2 Mon Sep 17 00:00:00 2001 From: Anna Kozlova Date: Fri, 12 Oct 2012 11:28:32 +0200 Subject: [PATCH] testng: support pattern for sets asserts "expected [] but got []" (IDEA-92770) --- .../src/com/theoryinpractice/testng/model/TestProxy.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/plugins/testng/src/com/theoryinpractice/testng/model/TestProxy.java b/plugins/testng/src/com/theoryinpractice/testng/model/TestProxy.java index 1b6ed0bcad14..7e2bf65d91d3 100644 --- a/plugins/testng/src/com/theoryinpractice/testng/model/TestProxy.java +++ b/plugins/testng/src/com/theoryinpractice/testng/model/TestProxy.java @@ -45,6 +45,8 @@ public class TestProxy extends AbstractTestProxy { Pattern.compile("(.*)expected same with:\\<(.*)\\> but was:\\<(.*)\\>.*", Pattern.DOTALL); @NonNls public static final Pattern EXPECTED_BUT_WAS_PATTERN = Pattern.compile("(.*)expected:\\<(.*)\\> but was:\\<(.*)\\>.*", Pattern.DOTALL); + @NonNls public static final Pattern EXPECTED_BUT_WAS_SET_PATTERN = + Pattern.compile("(.*)expected \\[(.*)\\] but got \\[(.*)\\].*", Pattern.DOTALL); @NonNls public static final Pattern EXPECTED_NOT_SAME_BUT_WAS_PATTERN = Pattern.compile("(.*)expected not same with:\\<(.*)\\> but was same:\\<(.*)\\>.*", Pattern.DOTALL); private final List results = new ArrayList(); @@ -344,6 +346,9 @@ public class TestProxy extends AbstractTestProxy { if (!matcher.matches()) { matcher = EXPECTED_BUT_WAS_PATTERN.matcher(s); } + if (!matcher.matches()) { + matcher = EXPECTED_BUT_WAS_SET_PATTERN.matcher(s); + } if (!matcher.matches()) { matcher = EXPECTED_NOT_SAME_BUT_WAS_PATTERN.matcher(s); }