File: UseCorrectAssertInTests.md

package info (click to toggle)
error-prone-java 2.18.0-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 23,204 kB
  • sloc: java: 222,992; xml: 1,319; sh: 25; makefile: 7
file content (5 lines) | stat: -rw-r--r-- 364 bytes parent folder | download | duplicates (2)
1
2
3
4
5
Java assert statements may or may not be evaluated depending on runtime flags to
the JVM invocation. When used in tests, this means that the test assertions may
not be checked, and a test may pass when it should actually fail. To avoid this,
use one of the assertion libraries that are always enabled, such as JUnit's
`org.junit.Assert` or Google's Truth library.