blob: 1feff79c2ce62ec2302cbdec7e855995946494a2 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
|
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")
}
}
|