mirror of
https://github.com/dutchcoders/transfer.sh.git
synced 2024-11-30 08:00:19 +01:00
cb6e5cb0c7
* use dep for vendoring * lets encrypt * moved web to transfer.sh-web repo * single command install * added first tests
28 lines
594 B
Go
28 lines
594 B
Go
package cli
|
|
|
|
import (
|
|
"os"
|
|
"reflect"
|
|
"runtime"
|
|
"strings"
|
|
"testing"
|
|
)
|
|
|
|
var (
|
|
wd, _ = os.Getwd()
|
|
)
|
|
|
|
func expect(t *testing.T, a interface{}, b interface{}) {
|
|
_, 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))
|
|
}
|
|
}
|
|
|
|
func refute(t *testing.T, a interface{}, b interface{}) {
|
|
if reflect.DeepEqual(a, b) {
|
|
t.Errorf("Did not expect %v (type %v) - Got %v (type %v)", b, reflect.TypeOf(b), a, reflect.TypeOf(a))
|
|
}
|
|
}
|