2
0
mirror of https://github.com/junegunn/fzf synced 2024-11-14 18:12:53 +00:00
fzf/src/util/atomicbool_test.go
2015-01-12 12:56:17 +09:00

18 lines
301 B
Go

package util
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")
}
}