diff options
author | Junegunn Choi <junegunn.c@gmail.com> | 2015-01-12 12:56:17 +0900 |
---|---|---|
committer | Junegunn Choi <junegunn.c@gmail.com> | 2015-01-12 12:56:17 +0900 |
commit | cd847affb79ea6438c9721635724efc6f58e2215 (patch) | |
tree | d1e631e3dca8832ee4c495924789f6697c3629cf /src/util/atomicbool_test.go | |
parent | 7a2bc2cada971c7a390d09b0afda34780ff56fb6 (diff) |
Reorganize source code
Diffstat (limited to 'src/util/atomicbool_test.go')
-rw-r--r-- | src/util/atomicbool_test.go | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/util/atomicbool_test.go b/src/util/atomicbool_test.go new file mode 100644 index 00000000..1feff79c --- /dev/null +++ b/src/util/atomicbool_test.go @@ -0,0 +1,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") + } +} |