package tpl
import (
"bytes"
"errors"
"fmt"
"github.com/stretchr/testify/assert"
"html/template"
"path"
"reflect"
"runtime"
"testing"
)
type tstNoStringer struct {
}
type tstCompareType int
const (
tstEq tstCompareType = iota
tstNe
tstGt
tstGe
tstLt
tstLe
)
func tstIsEq(tp tstCompareType) bool {
return tp == tstEq || tp == tstGe || tp == tstLe
}
func tstIsGt(tp tstCompareType) bool {
return tp == tstGt || tp == tstGe
}
func tstIsLt(tp tstCompareType) bool {
return tp == tstLt || tp == tstLe
}
func TestCompare(t *testing.T) {
for _, this := range []struct {
tstCompareType
funcUnderTest func(a, b interface{}) bool
}{
{tstGt, Gt},
{tstLt, Lt},
{tstGe, Ge},
{tstLe, Le},
{tstEq, Eq},
{tstNe, Ne},
} {
doTestCompare(t, this.tstCompareType, this.funcUnderTest)
}
}
func doTestCompare(t *testing.T, tp tstCompareType, funcUnderTest func(a, b interface{}) bool) {
for i, this := range []struct {
left interface{}
right interface{}
expectIndicator int
}{
{5