github.com/iotexproject/iotex-core@v1.14.1-rc1/pkg/tracer/tracer_test.go (about) 1 package tracer 2 3 import ( 4 "strconv" 5 "testing" 6 7 "github.com/stretchr/testify/require" 8 ) 9 10 func TestTracer(t *testing.T) { 11 require := require.New(t) 12 prv, err := NewProvider() 13 require.NoError(err) 14 require.Nil(prv) 15 16 _, err = NewProvider( 17 WithEndpoint("http://aa"), 18 WithSamplingRatio("4a32"), 19 ) 20 require.ErrorIs(err, strconv.ErrSyntax) 21 22 _, err = NewProvider( 23 WithEndpoint("http://aa"), 24 WithSamplingRatio(".5"), 25 ) 26 require.NoError(err) 27 }