Updating server dependancies. (#7816)
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
7304a61ef5
Коммит
1329aa51b6
7
vendor/github.com/segmentio/backo-go/vendor/github.com/bmizerany/assert/.gitignore
сгенерированный
поставляемый
Обычный файл
7
vendor/github.com/segmentio/backo-go/vendor/github.com/bmizerany/assert/.gitignore
сгенерированный
поставляемый
Обычный файл
@@ -0,0 +1,7 @@
|
||||
_go_.*
|
||||
_gotest_.*
|
||||
_obj
|
||||
_test
|
||||
_testmain.go
|
||||
*.out
|
||||
*.[568]
|
||||
45
vendor/github.com/segmentio/backo-go/vendor/github.com/bmizerany/assert/README.md
сгенерированный
поставляемый
Обычный файл
45
vendor/github.com/segmentio/backo-go/vendor/github.com/bmizerany/assert/README.md
сгенерированный
поставляемый
Обычный файл
@@ -0,0 +1,45 @@
|
||||
# Assert (c) Blake Mizerany and Keith Rarick -- MIT LICENCE
|
||||
|
||||
## Assertions for Go tests
|
||||
|
||||
## Install
|
||||
|
||||
$ go get github.com/bmizerany/assert
|
||||
|
||||
## Use
|
||||
|
||||
**point.go**
|
||||
|
||||
package point
|
||||
|
||||
type Point struct {
|
||||
x, y int
|
||||
}
|
||||
|
||||
**point_test.go**
|
||||
|
||||
|
||||
package point
|
||||
|
||||
import (
|
||||
"testing"
|
||||
"github.com/bmizerany/assert"
|
||||
)
|
||||
|
||||
func TestAsserts(t *testing.T) {
|
||||
p1 := Point{1, 1}
|
||||
p2 := Point{2, 1}
|
||||
|
||||
assert.Equal(t, p1, p2)
|
||||
}
|
||||
|
||||
**output**
|
||||
$ go test
|
||||
--- FAIL: TestAsserts (0.00 seconds)
|
||||
assert.go:15: /Users/flavio.barbosa/dev/stewie/src/point_test.go:12
|
||||
assert.go:24: ! X: 1 != 2
|
||||
FAIL
|
||||
|
||||
## Docs
|
||||
|
||||
http://github.com/bmizerany/assert
|
||||
76
vendor/github.com/segmentio/backo-go/vendor/github.com/bmizerany/assert/assert.go
сгенерированный
поставляемый
Обычный файл
76
vendor/github.com/segmentio/backo-go/vendor/github.com/bmizerany/assert/assert.go
сгенерированный
поставляемый
Обычный файл
@@ -0,0 +1,76 @@
|
||||
package assert
|
||||
// Testing helpers for doozer.
|
||||
|
||||
import (
|
||||
"github.com/kr/pretty"
|
||||
"reflect"
|
||||
"testing"
|
||||
"runtime"
|
||||
"fmt"
|
||||
)
|
||||
|
||||
func assert(t *testing.T, result bool, f func(), cd int) {
|
||||
if !result {
|
||||
_, file, line, _ := runtime.Caller(cd + 1)
|
||||
t.Errorf("%s:%d", file, line)
|
||||
f()
|
||||
t.FailNow()
|
||||
}
|
||||
}
|
||||
|
||||
func equal(t *testing.T, exp, got interface{}, cd int, args ...interface{}) {
|
||||
fn := func() {
|
||||
for _, desc := range pretty.Diff(exp, got) {
|
||||
t.Error("!", desc)
|
||||
}
|
||||
if len(args) > 0 {
|
||||
t.Error("!", " -", fmt.Sprint(args...))
|
||||
}
|
||||
}
|
||||
result := reflect.DeepEqual(exp, got)
|
||||
assert(t, result, fn, cd+1)
|
||||
}
|
||||
|
||||
func tt(t *testing.T, result bool, cd int, args ...interface{}) {
|
||||
fn := func() {
|
||||
t.Errorf("! Failure")
|
||||
if len(args) > 0 {
|
||||
t.Error("!", " -", fmt.Sprint(args...))
|
||||
}
|
||||
}
|
||||
assert(t, result, fn, cd+1)
|
||||
}
|
||||
|
||||
func T(t *testing.T, result bool, args ...interface{}) {
|
||||
tt(t, result, 1, args...)
|
||||
}
|
||||
|
||||
func Tf(t *testing.T, result bool, format string, args ...interface{}) {
|
||||
tt(t, result, 1, fmt.Sprintf(format, args...))
|
||||
}
|
||||
|
||||
func Equal(t *testing.T, exp, got interface{}, args ...interface{}) {
|
||||
equal(t, exp, got, 1, args...)
|
||||
}
|
||||
|
||||
func Equalf(t *testing.T, exp, got interface{}, format string, args ...interface{}) {
|
||||
equal(t, exp, got, 1, fmt.Sprintf(format, args...))
|
||||
}
|
||||
|
||||
func NotEqual(t *testing.T, exp, got interface{}, args ...interface{}) {
|
||||
fn := func() {
|
||||
t.Errorf("! Unexpected: <%#v>", exp)
|
||||
if len(args) > 0 {
|
||||
t.Error("!", " -", fmt.Sprint(args...))
|
||||
}
|
||||
}
|
||||
result := !reflect.DeepEqual(exp, got)
|
||||
assert(t, result, fn, 1)
|
||||
}
|
||||
|
||||
func Panic(t *testing.T, err interface{}, fn func()) {
|
||||
defer func() {
|
||||
equal(t, err, recover(), 3)
|
||||
}()
|
||||
fn()
|
||||
}
|
||||
15
vendor/github.com/segmentio/backo-go/vendor/github.com/bmizerany/assert/assert_test.go
сгенерированный
поставляемый
Обычный файл
15
vendor/github.com/segmentio/backo-go/vendor/github.com/bmizerany/assert/assert_test.go
сгенерированный
поставляемый
Обычный файл
@@ -0,0 +1,15 @@
|
||||
package assert
|
||||
|
||||
import (
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestLineNumbers(t *testing.T) {
|
||||
Equal(t, "foo", "foo", "msg!")
|
||||
//Equal(t, "foo", "bar", "this should blow up")
|
||||
}
|
||||
|
||||
func TestNotEqual(t *testing.T) {
|
||||
NotEqual(t, "foo", "bar", "msg!")
|
||||
//NotEqual(t, "foo", "foo", "this should blow up")
|
||||
}
|
||||
5
vendor/github.com/segmentio/backo-go/vendor/github.com/bmizerany/assert/example/point.go
сгенерированный
поставляемый
Обычный файл
5
vendor/github.com/segmentio/backo-go/vendor/github.com/bmizerany/assert/example/point.go
сгенерированный
поставляемый
Обычный файл
@@ -0,0 +1,5 @@
|
||||
package point
|
||||
|
||||
type Point struct {
|
||||
X, Y int
|
||||
}
|
||||
13
vendor/github.com/segmentio/backo-go/vendor/github.com/bmizerany/assert/example/point_test.go
сгенерированный
поставляемый
Обычный файл
13
vendor/github.com/segmentio/backo-go/vendor/github.com/bmizerany/assert/example/point_test.go
сгенерированный
поставляемый
Обычный файл
@@ -0,0 +1,13 @@
|
||||
package point
|
||||
|
||||
import (
|
||||
"testing"
|
||||
"assert"
|
||||
)
|
||||
|
||||
func TestAsserts(t *testing.T) {
|
||||
p1 := Point{1, 1}
|
||||
p2 := Point{2, 1}
|
||||
|
||||
assert.Equal(t, p1, p2)
|
||||
}
|
||||
Ссылка в новой задаче
Block a user