requirements.go raw

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