1
0
Fork 0
mirror of https://github.com/pomerium/pomerium.git synced 2025-05-15 10:07:47 +02:00
pomerium/internal/atomicutil/value_test.go
Caleb Doxsey 0ac7e45a21
atomicutil: use atomicutil.Value wherever possible ()
* atomicutil: use atomicutil.Value wherever possible

* fix test

* fix mux router
2022-07-28 15:38:38 -06:00

21 lines
347 B
Go

package atomicutil
import (
"testing"
"github.com/stretchr/testify/assert"
)
func TestValue(t *testing.T) {
v := NewValue(5)
assert.Equal(t, 5, v.Load())
t.Run("nil", func(t *testing.T) {
var v *Value[int]
assert.Equal(t, 0, v.Load())
})
t.Run("default", func(t *testing.T) {
var v Value[int]
assert.Equal(t, 0, v.Load())
})
}