Created
November 6, 2022 16:39
-
-
Save fredrb/f6d2cf31dfcf1260cc207407bdff377b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func Test_CheckValuesAreSame(t *testing.T) { | |
assert.With(t).Equal("a", "b") // assertion fails but tests continue | |
assert.With(t).Must().Equal("a", "b") // assertion fails and test stops | |
panic("This panic shouldn't happen") | |
} | |
func Test_FormatTesting(t *testing.T) { | |
assert.With(t).Messagef("%s should be equal %s", "a", "b"). | |
Equal("a", "b") | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment