google / google/truth

IntelliJ outputs error messages twice

Open
#680 13 comments 3 reactions 0 assignees View on GitHub
P3 type=enhancement
Dominant language
Java
Stars
2.8k
Forks
275
Avg merge
7m
Merged PRs (30d)
4

Description

I am working on IntelliJ 2019.3, with Truth 1.0 and Java 11.0.6, and running tests using Junit 5.6.0.

I'm trying to do test some basic assertions, such as checking the value of an int. However, IntelliJ is printing the messages twice:

```java
@Test
@Tag("D")
public void testDuplicateDemo() {
int x = 5;
assertThat(x).isEqualTo(10);
}
```
Outputs:

![Annotation 2020-04-19 010740](https://user-images.githubusercontent.com/12869082/79682819-37f6db80-81da-11ea-8c0c-dff7ec636619.jpg)

This is rather annoying and unexpected behavior. If I test equality of Strings, the same behavior is shown, unless the string has multiple lines, in which case, only expected / but was appears.

Why is this happening? Is there a workaround / fix? Thanks!

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.