github.com/mailgun/holster/v4@v4.20.0/tracing/scope_test.go (about)

     1  package tracing
     2  
     3  import (
     4  	"testing"
     5  
     6  	"github.com/stretchr/testify/assert"
     7  )
     8  
     9  func Test_getCallerSpanName(t *testing.T) {
    10  	gotSpanName, _ := getCallerSpanName(0)
    11  	assert.Equal(t, "github.com/mailgun/holster/v4/tracing.Test_getCallerSpanName", gotSpanName)
    12  
    13  	gotNestedSpanName := NestedCaller()
    14  	assert.Equal(t, "github.com/mailgun/holster/v4/tracing.Test_getCallerSpanName", gotNestedSpanName)
    15  }
    16  
    17  func NestedCaller() (spanName string) {
    18  	spanName, _ = getCallerSpanName(1)
    19  
    20  	return spanName
    21  }