...
1 package altsrc
2
3 import (
4 "os"
5 "reflect"
6 "runtime"
7 "strings"
8 "testing"
9 )
10
11 var (
12 wd, _ = os.Getwd()
13 )
14
15 func expect(t *testing.T, a interface{}, b interface{}) {
16 _, fn, line, _ := runtime.Caller(1)
17 fn = strings.Replace(fn, wd+"/", "", -1)
18
19 if !reflect.DeepEqual(a, b) {
20 t.Errorf("(%s:%d) Expected %v (type %v) - Got %v (type %v)", fn, line, b, reflect.TypeOf(b), a, reflect.TypeOf(a))
21 }
22 }
23
24 func refute(t *testing.T, a interface{}, b interface{}) {
25 _, fn, line, _ := runtime.Caller(1)
26 fn = strings.Replace(fn, wd+"/", "", -1)
27
28 if reflect.DeepEqual(a, b) {
29 t.Errorf("(%s:%d) Did not expect %v (type %v) - Got %v (type %v)", fn, line, b, reflect.TypeOf(b), a, reflect.TypeOf(a))
30 }
31 }
32
View as plain text