Skip to content

Latest commit

 

History

History
17 lines (13 loc) · 439 Bytes

README.md

File metadata and controls

17 lines (13 loc) · 439 Bytes

Go Generics

Matchers

Matchers provides a collection of utilities to write googletest inspired tests in golang.

import m "github.com/ntnj/go-generics/matchers"

func TestM(t *testing.T) {
  got := 42
  m.Expect(t, got, m.Eq(42))

  list := []int{2,4,6}
  m.Expect(t, list, m.Contains(m.Eq(4)))
  m.Expect(t, list, m.IsPermutationOf(m.Eq(4), m.Eq(6), m.Eq(2)))
}