Skip to content

Commit

Permalink
One more test
Browse files Browse the repository at this point in the history
  • Loading branch information
cleptric committed Nov 29, 2022
1 parent e9ab180 commit 1877d35
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions dynamic_sampling_context_test.go
Expand Up @@ -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",
})
Expand All @@ -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",
Expand All @@ -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)
}

0 comments on commit 1877d35

Please sign in to comment.