@@ -9,10 +9,6 @@ type Assertion struct {
99 t * testing.T
1010}
1111
12- // #########################
13- // ## Assertion Functions ##
14- // #########################
15-
1612// New returns an assertion instance for verifying invariants.
1713func New (t * testing.T ) * Assertion {
1814 a := new (Assertion )
@@ -25,6 +21,10 @@ func New(t *testing.T) *Assertion {
2521 return a
2622}
2723
24+ // #########################
25+ // ## Assertion Functions ##
26+ // #########################
27+
2828// DeepEqual tests deeply equality between actual and expect parameters.
2929func (a * Assertion ) DeepEqual (actual , expect any , message ... string ) error {
3030 return DeepEqual (a .t , actual , expect , message ... )
@@ -35,12 +35,16 @@ func (a *Assertion) NotDeepEqual(actual, expect any, message ...string) error {
3535 return NotDeepEqual (a .t , actual , expect , message ... )
3636}
3737
38- // Nil tests a value is nil or not, and it'll failed when the value is not nil.
38+ // Nil tests whether a value is nil or not, and it'll fail when the value is not nil. It will
39+ // always return false if the value is a bool, an integer, a floating number, a complex, or a
40+ // string.
3941func (a * Assertion ) Nil (val any , message ... string ) error {
4042 return Nil (a .t , val , message ... )
4143}
4244
43- // NotNil tests a value is nil or not, and it'll failed when the value is nil.
45+ // NotNil tests whether a value is nil or not, and it'll fail when the value is nil. It will
46+ // always return true if the value is a bool, an integer, a floating number, a complex, or a
47+ // string.
4448func (a * Assertion ) NotNil (val any , message ... string ) error {
4549 return NotNil (a .t , val , message ... )
4650}
0 commit comments