From 9ef8f55ba661671dabb96d6bd5332eb38dac54ef Mon Sep 17 00:00:00 2001 From: cpovirk Date: Thu, 27 Jan 2022 12:31:41 -0800 Subject: [PATCH] Fix test bug introduced in https://github.com/google/error-prone/commit/22f56480ed09db5c2b8e8b6897f41cb719dfce0e. Despite what the CL's description claimed, I changed "containsAllIn" to "containsExactlyElementsIn" instead of to "containsAtLeastElementsIn" as I'd intended. PiperOrigin-RevId: 424680868 --- .../testdata/input/WildcardUnificationTemplateExample.java | 3 +-- .../testdata/output/WildcardUnificationTemplateExample.java | 2 -- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/core/src/test/java/com/google/errorprone/refaster/testdata/input/WildcardUnificationTemplateExample.java b/core/src/test/java/com/google/errorprone/refaster/testdata/input/WildcardUnificationTemplateExample.java index 5f583806133..c383875c99a 100644 --- a/core/src/test/java/com/google/errorprone/refaster/testdata/input/WildcardUnificationTemplateExample.java +++ b/core/src/test/java/com/google/errorprone/refaster/testdata/input/WildcardUnificationTemplateExample.java @@ -27,10 +27,9 @@ */ public class WildcardUnificationTemplateExample { public void example() { - // BUG: The template should remove the hasSize call below! ImmutableList actual = ImmutableList.of("kurt", "kluever"); ImmutableList expected = ImmutableList.of("kluever", "kurt"); assertThat(actual).hasSize(expected.size()); - assertThat(actual).containsExactlyElementsIn(expected); + assertThat(actual).containsAtLeastElementsIn(expected); } } diff --git a/core/src/test/java/com/google/errorprone/refaster/testdata/output/WildcardUnificationTemplateExample.java b/core/src/test/java/com/google/errorprone/refaster/testdata/output/WildcardUnificationTemplateExample.java index 5f583806133..2879645caa6 100644 --- a/core/src/test/java/com/google/errorprone/refaster/testdata/output/WildcardUnificationTemplateExample.java +++ b/core/src/test/java/com/google/errorprone/refaster/testdata/output/WildcardUnificationTemplateExample.java @@ -27,10 +27,8 @@ */ public class WildcardUnificationTemplateExample { public void example() { - // BUG: The template should remove the hasSize call below! ImmutableList actual = ImmutableList.of("kurt", "kluever"); ImmutableList expected = ImmutableList.of("kluever", "kurt"); - assertThat(actual).hasSize(expected.size()); assertThat(actual).containsExactlyElementsIn(expected); } }