I use multiple programming languages and writing automated tests is one of the confusing parts. This is a cheat sheet to quickly check the difference of testing libraries.
Go's standard testing package doesn't provide assert functions. A lot of projects use
- assert.Equal(t, expected, actual)
- require.Equal(t, expected, actual)
- is(actual, expected)
- assert expr
- assert_eq!(left, right)
It let developers decide which one is
expected, according to the Rust Programming Language.
- assertThat(actual, matcher)
- assertEquals(expected, actual)
- assertEquals(actual, expected)