You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

27 lines
375 B

  1. package sync
  2. import (
  3. "testing"
  4. "github.com/stretchr/testify/assert"
  5. )
  6. func TestDefaultValue(t *testing.T) {
  7. t.Parallel()
  8. v := NewBool(false)
  9. assert.False(t, v.IsSet())
  10. v = NewBool(true)
  11. assert.True(t, v.IsSet())
  12. }
  13. func TestSetUnSet(t *testing.T) {
  14. t.Parallel()
  15. v := NewBool(false)
  16. v.Set()
  17. assert.True(t, v.IsSet())
  18. v.UnSet()
  19. assert.False(t, v.IsSet())
  20. }