mirror of
https://github.com/duke-git/lancet.git
synced 2026-02-04 12:52:28 +08:00
Add optional (#170)
* Add optional Wrapper container with easy to understand helper methods * Add test and rewrite test * Add panic test * Add TestOrElseGetHappyPath
This commit is contained in:
@@ -37,6 +37,20 @@ func (a *Assert) Equal(expected, actual any) {
|
||||
}
|
||||
}
|
||||
|
||||
// ShouldBeFalse check if expected is false
|
||||
func (a *Assert) ShouldBeFalse(actual any) {
|
||||
if compare(false, actual) != compareEqual {
|
||||
makeTestFailed(a.T, a.CaseName, false, actual)
|
||||
}
|
||||
}
|
||||
|
||||
// ShouldBeTrue check if expected is true
|
||||
func (a *Assert) ShouldBeTrue(actual any) {
|
||||
if compare(true, actual) != compareEqual {
|
||||
makeTestFailed(a.T, a.CaseName, true, actual)
|
||||
}
|
||||
}
|
||||
|
||||
// NotEqual check if expected is not equal with actual
|
||||
func (a *Assert) NotEqual(expected, actual any) {
|
||||
if compare(expected, actual) == compareEqual {
|
||||
|
||||
Reference in New Issue
Block a user