fzf/src/util/atomicbool_test.go

18 lines
301 B
Go
Raw Normal View History

2015-01-12 03:56:17 +00:00
package util
2015-01-01 19:49:30 +00:00
import "testing"
func TestAtomicBool(t *testing.T) {
if !NewAtomicBool(true).Get() || NewAtomicBool(false).Get() {
t.Error("Invalid initial value")
}
ab := NewAtomicBool(true)
if ab.Set(false) {
t.Error("Invalid return value")
}
if ab.Get() {
t.Error("Invalid state")
}
}