func TestValues_MaximumNative(t *testing.T) {
	assert.Nil(t, MaximumNativeType("path", "in", int(5), 10, false))
	assert.Nil(t, MaximumNativeType("path", "in", uint(5), 10, true))
	assert.Nil(t, MaximumNativeType("path", "in", int8(5), 10, true))
	assert.Nil(t, MaximumNativeType("path", "in", uint8(5), 10, true))
	assert.Nil(t, MaximumNativeType("path", "in", int16(5), 10, true))
	assert.Nil(t, MaximumNativeType("path", "in", uint16(5), 10, true))
	assert.Nil(t, MaximumNativeType("path", "in", int32(5), 10, true))
	assert.Nil(t, MaximumNativeType("path", "in", uint32(5), 10, true))
	assert.Nil(t, MaximumNativeType("path", "in", int64(5), 10, true))
	assert.Nil(t, MaximumNativeType("path", "in", uint64(5), 10, true))
	assert.Nil(t, MaximumNativeType("path", "in", float32(5.5), 10, true))
	assert.Nil(t, MaximumNativeType("path", "in", float64(5.5), 10, true))
	var err *errors.Validation
	err = MaximumNativeType("path", "in", int32(10), 10, true)
	if assert.NotNil(t, err) {
		code := int(err.Code())
		assert.Equal(t, code, errors.MaxFailCode)
	}
	err = MaximumNativeType("path", "in", uint(10), 10, true)
	if assert.NotNil(t, err) {
		code := int(err.Code())
		assert.Equal(t, code, errors.MaxFailCode)
	}
	err = MaximumNativeType("path", "in", int64(12), 10, false)
	if assert.NotNil(t, err) {
		code := int(err.Code())
		assert.Equal(t, code, errors.MaxFailCode)
	}
	err = MaximumNativeType("path", "in", float32(12.6), 10, false)
	if assert.NotNil(t, err) {
		code := int(err.Code())
		assert.Equal(t, code, int(errors.MaxFailCode))
	}
	err = MaximumNativeType("path", "in", float64(12.6), 10, false)
	if assert.NotNil(t, err) {
		code := int(err.Code())
		assert.Equal(t, code, int(errors.MaxFailCode))
	}
	err = MaximumNativeType("path", "in", uint(5), -10, true)
	if assert.NotNil(t, err) {
		code := int(err.Code())
		assert.Equal(t, code, int(errors.MaxFailCode))
	}
}
Test edge cases in MaximumNativeType
not easily exercised with full specs
package validate
import (
	"math"
	"testing"
	"github.com/stretchr/testify/assert"
	"k8s.io/kube-openapi/pkg/validation/errors"
	"k8s.io/kube-openapi/pkg/validation/strfmt"
)
func TestValues_ValidateIntEnum(t *testing.T) {
	enumValues := []interface{}{1, 2, 3}
	err := Enum("test", "body", int64(5), enumValues)
	assert.NotNil(t, err)
	err2 := Enum("test", "body", int64(1), enumValues)
	assert.Nil(t, err2)
}
func TestValues_ValidateEnum(t *testing.T) {
	enumValues := []string{"aa", "bb", "cc"}
	err := Enum("test", "body", "a", enumValues)
	assert.Error(t, err)
	err = Enum("test", "body", "bb", enumValues)
	assert.Nil(t, err)
}
func TestValues_Enum_EdgeCases(t *testing.T) {
	enumValues := "aa, bb, cc"
	err := Enum("test", "body", int64(1), enumValues)
	assert.Nil(t, err)
}
func TestValues_ValidateUniqueItems(t *testing.T) {
	var err error
	itemsNonUnique := []interface{}{
		[]int32{1, 2, 3, 4, 4, 5},
		[]string{"aa", "bb", "cc", "cc", "dd"},
	}
	for _, v := range itemsNonUnique {
		err = UniqueItems("test", "body", v)
		assert.Error(t, err)
	}
	itemsUnique := []interface{}{
		[]int32{1, 2, 3},
		"I'm a string",
		map[string]int{
			"aaa": 1111,
			"b":   2,
			"ccc": 333,
		},
		nil,
	}
	for _, v := range itemsUnique {
		err = UniqueItems("test", "body", v)
		assert.Nil(t, err)
	}
}
func TestValues_ValidateMinLength(t *testing.T) {
	var minLength int64 = 5
	err := MinLength("test", "body", "aa", minLength)
	assert.Error(t, err)
	err = MinLength("test", "body", "aaaaa", minLength)
	assert.Nil(t, err)
}
func TestValues_ValidateMaxLength(t *testing.T) {
	var maxLength int64 = 5
	err := MaxLength("test", "body", "bbbbbb", maxLength)
	assert.Error(t, err)
	err = MaxLength("test", "body", "aa", maxLength)
	assert.Nil(t, err)
}
func TestValues_ValidateRequired(t *testing.T) {
	var err error
	path := "test"
	in := "body"
	RequiredFail := []interface{}{
		"",
		0,
		nil,
	}
	for _, v := range RequiredFail {
		err = Required(path, in, v)
		assert.Error(t, err)
	}
	RequiredSuccess := []interface{}{
		" ",
		"bla-bla-bla",
		2,
		[]interface{}{21, []int{}, "testString"},
	}
	for _, v := range RequiredSuccess {
		err = Required(path, in, v)
		assert.Nil(t, err)
	}
}
func TestValuMultipleOf(t *testing.T) {
	err := MultipleOf("test", "body", 9, 3)
	assert.Nil(t, err)
	err = MultipleOf("test", "body", 9.3, 3.1)
	assert.Nil(t, err)
	err = MultipleOf("test", "body", 9.1, 0.1)
	assert.Nil(t, err)
	err = MultipleOf("test", "body", 3, 0.3)
	assert.Nil(t, err)
	err = MultipleOf("test", "body", 6, 0.3)
	assert.Nil(t, err)
	err = MultipleOf("test", "body", 1, 0.25)
	assert.Nil(t, err)
	err = MultipleOf("test", "body", 8, 0.2)
	assert.Nil(t, err)
	err = MultipleOf("test", "body", 3, 0.4)
	assert.Error(t, err)
	err = MultipleOf("test", "body", 9.1, 0.2)
	assert.Error(t, err)
	err = MultipleOf("test", "body", 9.34, 0.1)
	assert.Error(t, err)
	err = MultipleOf("test", "body", 9.34, -0.1)
	assert.Error(t, err)
}
func TestValues_Pattern_Edgecases(t *testing.T) {
	var err *errors.Validation
	err = Pattern("path", "in", "pick-a-boo", `.*-[a-z]-.*`)
	assert.Nil(t, err)
	err = Pattern("path", "in", "pick-a-boo", `.*-[a(-z]-^).*`)
	if assert.NotNil(t, err) {
		assert.Equal(t, int(err.Code()), int(errors.PatternFailCode))
		assert.Contains(t, err.Error(), "pattern is invalid")
	}
	err = Pattern("path", "in", "pick-8-boo", `.*-[a-z]-.*`)
	if assert.NotNil(t, err) {
		assert.Equal(t, int(err.Code()), int(errors.PatternFailCode))
		assert.NotContains(t, err.Error(), "pattern is invalid")
		assert.Contains(t, err.Error(), "should match")
	}
}
func TestValues_FormatOf_EdgeCases(t *testing.T) {
	var err *errors.Validation
	err = FormatOf("path", "in", "bugz", "", nil)
	if assert.NotNil(t, err) {
		assert.Equal(t, int(err.Code()), int(errors.InvalidTypeCode))
		assert.Contains(t, err.Error(), "bugz is an invalid type name")
	}
	err = FormatOf("path", "in", "bugz", "", strfmt.Default)
	if assert.NotNil(t, err) {
		assert.Equal(t, int(err.Code()), int(errors.InvalidTypeCode))
		assert.Contains(t, err.Error(), "bugz is an invalid type name")
	}
}