Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
import static com.google.common.truth.TestCorrespondences.WITHIN_10_OF;
import static com.google.common.truth.Truth.assertThat;
import static java.util.Arrays.asList;
import static java.util.Collections.singletonList;
import static org.junit.Assert.assertThrows;

import com.google.common.collect.ImmutableList;
Expand Down Expand Up @@ -1273,10 +1274,12 @@ public void containsExactly_nullValueInArray() {
.containsExactly(128, null);
}

// We intentionally test the behavior of the method under a call that will soon fail.
@SuppressWarnings("NullNeedsCastForVarargs")
@Test
public void containsExactly_nullArray() {
// Truth is tolerant of this erroneous varargs call.
List<String> actual = Arrays.asList((String) null);
List<String> actual = singletonList(null);
IterableSubject.UsingCorrespondence<String, Integer> subject =
assertThat(actual).comparingElementsUsing(STRING_PARSES_TO_INTEGER_CORRESPONDENCE);
Ordered ordered;
Expand Down
Loading