requirements.go 1.1 KB

1234567891011121314151617181920212223242526272829
  1. package require
  2. // TestingT is an interface wrapper around *testing.T
  3. type TestingT interface {
  4. Errorf(format string, args ...interface{})
  5. FailNow()
  6. }
  7. type tHelper interface {
  8. Helper()
  9. }
  10. // ComparisonAssertionFunc is a common function prototype when comparing two values. Can be useful
  11. // for table driven tests.
  12. type ComparisonAssertionFunc func(TestingT, interface{}, interface{}, ...interface{})
  13. // ValueAssertionFunc is a common function prototype when validating a single value. Can be useful
  14. // for table driven tests.
  15. type ValueAssertionFunc func(TestingT, interface{}, ...interface{})
  16. // BoolAssertionFunc is a common function prototype when validating a bool value. Can be useful
  17. // for table driven tests.
  18. type BoolAssertionFunc func(TestingT, bool, ...interface{})
  19. // ErrorAssertionFunc is a common function prototype when validating an error value. Can be useful
  20. // for table driven tests.
  21. type ErrorAssertionFunc func(TestingT, error, ...interface{})
  22. //go:generate sh -c "cd ../_codegen && go build && cd - && ../_codegen/_codegen -output-package=require -template=require.go.tmpl -include-format-funcs"