"bytes"
"io/ioutil"
"os"
- "reflect"
"strings"
"testing"
)
var bigtest = pairs[len(pairs)-1]
-func testEqual(t *testing.T, msg string, args ...) bool {
- v := reflect.NewValue(args).(*reflect.StructValue)
- v1 := v.Field(v.NumField() - 2)
- v2 := v.Field(v.NumField() - 1)
- if v1.Interface() != v2.Interface() {
+func testEqual(t *testing.T, msg string, args ...interface{}) bool {
+ if args[len(args)-2] != args[len(args)-1] {
t.Errorf(msg, args)
return false
}
"bytes"
"io/ioutil"
"os"
- "reflect"
"strings"
"testing"
)
"VHdhcyBicmlsbGlnLCBhbmQgdGhlIHNsaXRoeSB0b3Zlcw==",
}
-func testEqual(t *testing.T, msg string, args ...) bool {
- v := reflect.NewValue(args).(*reflect.StructValue)
- v1 := v.Field(v.NumField() - 2)
- v2 := v.Field(v.NumField() - 1)
- if v1.Interface() != v2.Interface() {
+func testEqual(t *testing.T, msg string, args ...interface{}) bool {
+ if args[len(args)-2] != args[len(args)-1] {
t.Errorf(msg, args)
return false
}
"bytes"
"io/ioutil"
"os"
- "reflect"
"strings"
"testing"
)
decoded, encoded string
}
-func testEqual(t *testing.T, msg string, args ...) bool {
- v := reflect.NewValue(args).(*reflect.StructValue)
- v1 := v.Field(v.NumField() - 2)
- v2 := v.Field(v.NumField() - 1)
- if v1.Interface() != v2.Interface() {
+func testEqual(t *testing.T, msg string, args ...interface{}) bool {
+ if args[len(args)-2] != args[len(args)-1] {
t.Errorf(msg, args)
return false
}
var buf bytes.Buffer
_, err := f.Fprint(&buf, nil, args)
if err != nil {
- fmt.Fprintf(&buf, "--- Sprint(%s) failed: %v", fmt.Sprint(args), err)
+ var i interface{} = args
+ fmt.Fprintf(&buf, "--- Sprint(%s) failed: %v", fmt.Sprint(i), err)
}
return buf.String()
}