gb vendor fetch github.com/opentracing/go-opentracing
This commit is contained in:
parent
f11af1e78f
commit
88dde65efc
25 changed files with 3010 additions and 0 deletions
31
vendor/src/github.com/opentracing/opentracing-go/options_test.go
vendored
Normal file
31
vendor/src/github.com/opentracing/opentracing-go/options_test.go
vendored
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
package opentracing
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
|
||||
func TestChildOfAndFollowsFrom(t *testing.T) {
|
||||
tests := []struct {
|
||||
newOpt func(SpanContext) SpanReference
|
||||
refType SpanReferenceType
|
||||
name string
|
||||
}{
|
||||
{ChildOf, ChildOfRef, "ChildOf"},
|
||||
{FollowsFrom, FollowsFromRef, "FollowsFrom"},
|
||||
}
|
||||
|
||||
for _, test := range tests {
|
||||
opts := new(StartSpanOptions)
|
||||
|
||||
test.newOpt(nil).Apply(opts)
|
||||
require.Nil(t, opts.References, "%s(nil) must not append a reference", test.name)
|
||||
|
||||
ctx := new(noopSpanContext)
|
||||
test.newOpt(ctx).Apply(opts)
|
||||
require.Equal(t, []SpanReference{
|
||||
SpanReference{ReferencedContext: ctx, Type: test.refType},
|
||||
}, opts.References, "%s(ctx) must append a reference", test.name)
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue