Documentation ¶
Overview ¶
This package provides a simpler way to write unit tests in golang. You can write a unit test in such coding style:
func TestExpect(t *testing.T) { expect.Bind(t).Expect("it" + " " + "works").ToBe("it works") var e = expect.Bind(t) e.Expect(1 + 1).ToBe(2) e.Expect(2 + 2).ToBe(4) }
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ExpectHandler ¶
type ExpectHandler struct { TesterHandler // contains filtered or unexported fields }
func (*ExpectHandler) ToBe ¶
func (e *ExpectHandler) ToBe(expect any)
type TesterHandler ¶
type TesterHandler struct {
// contains filtered or unexported fields
}
func Bind ¶
func Bind(testing *testing.T) *TesterHandler
func (*TesterHandler) Expect ¶
func (t *TesterHandler) Expect(actual any) *ExpectHandler
Click to show internal directories.
Click to hide internal directories.