Skip to content
Myr

atomicbool_test.go

This file

Path

src/util/atomicbool_test.go

17 lines · 301 bytes · Go

Last changed by

Not known.

History of this file

Take it

1package util23import "testing"45func TestAtomicBool(t *testing.T) {6	if !NewAtomicBool(true).Get() || NewAtomicBool(false).Get() {7		t.Error("Invalid initial value")8	}910	ab := NewAtomicBool(true)11	if ab.Set(false) {12		t.Error("Invalid return value")13	}14	if ab.Get() {15		t.Error("Invalid state")16	}17}