mirror of
https://github.com/pomerium/pomerium.git
synced 2025-04-30 10:56:28 +02:00
* upgrade to go v1.24 * add a macOS-specific //nolint comment too --------- Co-authored-by: Kenneth Jenkins <51246568+kenjenkins@users.noreply.github.com>
31 lines
668 B
Go
31 lines
668 B
Go
package trace_test
|
|
|
|
import (
|
|
"net/url"
|
|
"testing"
|
|
|
|
"github.com/stretchr/testify/assert"
|
|
|
|
"github.com/pomerium/pomerium/pkg/telemetry/trace"
|
|
)
|
|
|
|
func TestPomeriumURLQueryCarrier(t *testing.T) {
|
|
t.Parallel()
|
|
values := url.Values{}
|
|
carrier := trace.PomeriumURLQueryCarrier(values)
|
|
assert.Empty(t, carrier.Get("foo"))
|
|
carrier.Set("foo", "bar")
|
|
assert.Equal(t, url.Values{
|
|
"pomerium_foo": []string{"bar"},
|
|
}, values)
|
|
assert.Equal(t, "bar", carrier.Get("foo"))
|
|
carrier.Set("foo", "bar2")
|
|
assert.Equal(t, url.Values{
|
|
"pomerium_foo": []string{"bar2"},
|
|
}, values)
|
|
assert.Equal(t, "bar2", carrier.Get("foo"))
|
|
|
|
assert.Panics(t, func() {
|
|
carrier.Keys()
|
|
})
|
|
}
|