// Implements asserts that an object is implemented by the specified interface.
//
//    assert.Implements(t, (*MyInterface)(nil), new(MyObject))
3734
func Implements(t TestingT, interfaceObject interface{}, object interface{}, msgAndArgs ...interface{}) {
	if h, ok := t.(tHelper); ok {
		h.Helper()
	}
	if assert.Implements(t, interfaceObject, object, msgAndArgs...) {
		return
	}
	t.FailNow()
}
640284
func Assert(condition bool, format string, args ...interface{}) {
	if !condition {
		Panicf(format, args...)
	}
}
46381
func AssertLe(x, y interface{}, errorParts ...interface{}) {
	assertThat(x, oglematchers.LessOrEqual(y), 1, errorParts)
}
1101240
func parseImplementsInterfaces(parser *Parser) ([]*ast.Named, error) {
	types := []*ast.Named{}
	if parser.Token.Value == "implements" {
		if err := advance(parser); err != nil {
			return nil, err
		}
		// optional leading ampersand
		skip(parser, lexer.AMP)
		for {
			ttype, err := parseNamed(parser)
			if err != nil {
				return types, err
			}
			types = append(types, ttype)
			if skipped, err := skip(parser, lexer.AMP); !skipped {
				break
			} else if err != nil {
				return types, err
			}
		}
	}
	return types, nil
}
1028596
func ImplementsPostJSONUnmarshaler(v interface{}) bool {
	value := reflect.ValueOf(v)
	if value.Kind() == reflect.Ptr && value.IsNil() {
		return false
	}

	_, ok := value.Interface().(PostJSONUnmarshaler)
	return ok
}
1150816
func Assert(t Fatalf, have, want interface{}) {
	if !reflect.DeepEqual(have, want) {
		file, line := caller()
		t.Fatalf(equal, file, line, "", have, have, want, want)
	}
}
923595
func Assert(t crossdock.T, tt TT, desc string, got interface{}, err error) {
	checks := crossdock.Checks(t)
	assert := crossdock.Assert(t)

	if tt.WantError != nil || tt.WantErrorLike != "" {
		if !checks.Error(err, "%v: expected failure but got: %v", desc, got) {
			return
		}
		if tt.WantError != nil {
			assert.Equal(tt.WantError, err, "%v: server returned error: %v", desc, err)
		}
		if tt.WantErrorLike != "" {
			assert.Contains(err.Error(), tt.WantErrorLike, "%v: server returned error: %v", desc, err)
		}
	} else {
		if !checks.NoError(err, "%v: call failed", desc) {
			return
		}
		if tt.Want != nil {
			assert.Equal(tt.Want, got, "%v: server returned: %v", desc, got)
		}
	}
}
781044
func (enc *Encoder) AddInterface(value interface{}) {
	switch vt := value.(type) {
	case string:
		enc.AddString(vt)
	case bool:
		enc.AddBool(vt)
	case MarshalerJSONArray:
		enc.AddArray(vt)
	case MarshalerJSONObject:
		enc.AddObject(vt)
	case int:
		enc.AddInt(vt)
	case int64:
		enc.AddInt(int(vt))
	case int32:
		enc.AddInt(int(vt))
	case int8:
		enc.AddInt(int(vt))
	case uint64:
		enc.AddUint64(vt)
	case uint32:
		enc.AddInt(int(vt))
	case uint16:
		enc.AddInt(int(vt))
	case uint8:
		enc.AddInt(int(vt))
	case float64:
		enc.AddFloat(vt)
	case float32:
		enc.AddFloat32(vt)
	default:
		if vt != nil {
			enc.err = InvalidMarshalError(fmt.Sprintf(invalidMarshalErrorMsg, vt))
			return
		}
		return
	}
}
868687
func (c *Call) Do(f interface{}) *Call {
	// TODO: Check arity and types here, rather than dying badly elsewhere.
	v := reflect.ValueOf(f)

	c.addAction(func(args []interface{}) []interface{} {
		vargs := make([]reflect.Value, len(args))
		ft := v.Type()
		for i := 0; i < len(args); i++ {
			if args[i] != nil {
				vargs[i] = reflect.ValueOf(args[i])
			} else {
				// Use the zero value for the arg.
				vargs[i] = reflect.Zero(ft.In(i))
			}
		}
		v.Call(vargs)
		return nil
	})
	return c
}
585201
func Implementsf(t TestingT, interfaceObject interface{}, object interface{}, msg string, args ...interface{}) bool {
	if h, ok := t.(tHelper); ok {
		h.Helper()
	}
	return Implements(t, interfaceObject, object, append([]interface{}{msg}, args...)...)
}
553440
func IsType(t TestingT, expectedType interface{}, object interface{}, msgAndArgs ...interface{}) {
	if h, ok := t.(tHelper); ok {
		h.Helper()
	}
	if assert.IsType(t, expectedType, object, msgAndArgs...) {
		return
	}
	t.FailNow()
}
958480
func AssertNe(expected, actual interface{}, errorParts ...interface{}) {
	assertThat(
		actual,
		oglematchers.Not(oglematchers.Equals(expected)),
		1,
		errorParts)
}
60299
func (args Arguments) Assert(t TestingT, objects ...interface{}) bool {
	if h, ok := t.(tHelper); ok {
		h.Helper()
	}

	// get the differences
	diff, diffCount := args.Diff(objects)

	if diffCount == 0 {
		return true
	}

	// there are differences... report them...
	t.Logf(diff)
	t.Errorf("%sArguments do not match.", assert.CallerInfo())

	return false

}
342916
func Clone(v interface{}) interface{} {
	value := reflect.ValueOf(v)
	copy := clone(value)
	return copy.Interface()
}
277136
func AssertLt(x, y interface{}, errorParts ...interface{}) {
	assertThat(x, oglematchers.LessThan(y), 1, errorParts)
}
1036770
func (t *ObjType) Method(name string) (ObjMethod, error) {
	m, ok := t.method[name]
	if !ok {
		return ObjMethod{}, ErrMethodNotFound
	}
	return *m, nil
}
1335257
func (scope *ArgScope) InjectTo(obj interface{}) error {
	structValue := reflect.ValueOf(obj).Elem()
	for i := 0; i < structValue.NumField(); i++ {
		var isRequired = true
		valueField := structValue.Field(i)
		structField := structValue.Type().Field(i)
		key := structField.Tag.Get(scope.tagname)
		if key == "" {
			continue
		}
		if strings.HasPrefix(key, "?") {
			isRequired = false
			key = key[1:]
		}
		switch valueField.Interface().(type) {
		case string:
			value, ok := scope.data[key]
			if !ok {
				if !isRequired {
					continue
				}
				return fmt.Errorf("Don't contains a argument for %v", key)
			}
			valueField.Set(reflect.ValueOf(value))
		default:
			value, ok := scope.data[key]
			if !ok {
				if !isRequired {
					continue
				}
				return fmt.Errorf("Don't contains a string for %v", key)
			}
			r.SetValueFromString(valueField, value)
		}
	}
	return nil
}