package assert

import (
	
	
)

// isOrdered checks that collection contains orderable elements.
func isOrdered( TestingT,  interface{},  []compareResult,  string,  ...interface{}) bool {
	 := reflect.TypeOf().Kind()
	if  != reflect.Slice &&  != reflect.Array {
		return false
	}

	 := reflect.ValueOf()
	 := .Len()

	if  <= 1 {
		return true
	}

	 := .Index(0)
	 := .Interface()
	 := .Kind()

	for  := 1;  < ; ++ {
		 := 
		 := 

		 = .Index()
		 = .Interface()

		,  := compare(, , )

		if ! {
			return Fail(, fmt.Sprintf(`Can not compare type "%T" and "%T"`, , ), ...)
		}

		if !containsValue(, ) {
			return Fail(, fmt.Sprintf(, , ), ...)
		}
	}

	return true
}

// IsIncreasing asserts that the collection is increasing
//
//	assert.IsIncreasing(t, []int{1, 2, 3})
//	assert.IsIncreasing(t, []float{1, 2})
//	assert.IsIncreasing(t, []string{"a", "b"})
func ( TestingT,  interface{},  ...interface{}) bool {
	return isOrdered(, , []compareResult{compareLess}, "\"%v\" is not less than \"%v\"", ...)
}

// IsNonIncreasing asserts that the collection is not increasing
//
//	assert.IsNonIncreasing(t, []int{2, 1, 1})
//	assert.IsNonIncreasing(t, []float{2, 1})
//	assert.IsNonIncreasing(t, []string{"b", "a"})
func ( TestingT,  interface{},  ...interface{}) bool {
	return isOrdered(, , []compareResult{compareEqual, compareGreater}, "\"%v\" is not greater than or equal to \"%v\"", ...)
}

// IsDecreasing asserts that the collection is decreasing
//
//	assert.IsDecreasing(t, []int{2, 1, 0})
//	assert.IsDecreasing(t, []float{2, 1})
//	assert.IsDecreasing(t, []string{"b", "a"})
func ( TestingT,  interface{},  ...interface{}) bool {
	return isOrdered(, , []compareResult{compareGreater}, "\"%v\" is not greater than \"%v\"", ...)
}

// IsNonDecreasing asserts that the collection is not decreasing
//
//	assert.IsNonDecreasing(t, []int{1, 1, 2})
//	assert.IsNonDecreasing(t, []float{1, 2})
//	assert.IsNonDecreasing(t, []string{"a", "b"})
func ( TestingT,  interface{},  ...interface{}) bool {
	return isOrdered(, , []compareResult{compareLess, compareEqual}, "\"%v\" is not less than or equal to \"%v\"", ...)
}