diff --git a/dynamic_sampling_context_test.go b/dynamic_sampling_context_test.go index e262949ee..36be8c50e 100644 --- a/dynamic_sampling_context_test.go +++ b/dynamic_sampling_context_test.go @@ -89,7 +89,7 @@ func TestDynamicSamplingContextFromTransaction(t *testing.T) { input: func() *Span { ctx := NewTestContext(ClientOptions{ EnableTracing: true, - TracesSampleRate: 1.0, + TracesSampleRate: 0.5, Dsn: "http://public@example.com/sentry/1", Release: "1.0.0", }) @@ -100,7 +100,7 @@ func TestDynamicSamplingContextFromTransaction(t *testing.T) { want: DynamicSamplingContext{ Frozen: true, Entries: map[string]string{ - "sample_rate": "1.0", + "sample_rate": "0.5", "trace_id": "d49d9bf66f13450b81f65bc51cf49c03", "public_key": "public", "release": "1.0.0", @@ -117,3 +117,17 @@ func TestDynamicSamplingContextFromTransaction(t *testing.T) { assertEqual(t, got, tc.want) } } + +func TestHasEntries(t *testing.T) { + var dsc DynamicSamplingContext + + dsc = DynamicSamplingContext{} + assertEqual(t, dsc.HasEntries(), false) + + dsc = DynamicSamplingContext{ + Entries: map[string]string{ + "foo": "bar", + }, + } + assertEqual(t, dsc.HasEntries(), true) +}