本站源代码
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

30 lines
1.1KB

  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 go run ../_codegen/main.go -output-package=require -template=require.go.tmpl -include-format-funcs
上海开阖软件有限公司 沪ICP备12045867号-1