2015-12-09 17:15:46 +00:00
|
|
|
package altsrc
|
2015-12-06 23:43:18 +00:00
|
|
|
|
|
|
|
import (
|
2016-05-16 14:18:15 +00:00
|
|
|
"os"
|
2015-12-06 23:43:18 +00:00
|
|
|
"reflect"
|
2016-05-16 14:18:15 +00:00
|
|
|
"runtime"
|
|
|
|
"strings"
|
2015-12-06 23:43:18 +00:00
|
|
|
"testing"
|
|
|
|
)
|
|
|
|
|
2016-05-16 14:18:15 +00:00
|
|
|
var (
|
|
|
|
wd, _ = os.Getwd()
|
|
|
|
)
|
|
|
|
|
2015-12-06 23:43:18 +00:00
|
|
|
func expect(t *testing.T, a interface{}, b interface{}) {
|
2016-05-16 14:18:15 +00:00
|
|
|
_, fn, line, _ := runtime.Caller(1)
|
|
|
|
fn = strings.Replace(fn, wd+"/", "", -1)
|
|
|
|
|
|
|
|
if !reflect.DeepEqual(a, b) {
|
|
|
|
t.Errorf("(%s:%d) Expected %v (type %v) - Got %v (type %v)", fn, line, b, reflect.TypeOf(b), a, reflect.TypeOf(a))
|
2015-12-06 23:43:18 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
func refute(t *testing.T, a interface{}, b interface{}) {
|
2022-04-26 02:15:39 +00:00
|
|
|
_, fn, line, _ := runtime.Caller(1)
|
|
|
|
fn = strings.Replace(fn, wd+"/", "", -1)
|
|
|
|
|
|
|
|
if reflect.DeepEqual(a, b) {
|
|
|
|
t.Errorf("(%s:%d) Did not expect %v (type %v) - Got %v (type %v)", fn, line, b, reflect.TypeOf(b), a, reflect.TypeOf(a))
|
2015-12-06 23:43:18 +00:00
|
|
|
}
|
|
|
|
}
|