diff options
-rw-r--r-- | stm_test.go | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/stm_test.go b/stm_test.go index 527e480..28f56ec 100644 --- a/stm_test.go +++ b/stm_test.go @@ -15,12 +15,10 @@ func TestDecrement(t *testing.T) { } done := make(chan struct{}) go func() { - for { - if AtomicGet(x).(int) == 500 { - break - } - } - done <- struct{}{} + Atomically(func(tx *Tx) { + tx.Assert(tx.Get(x) == 500) + }) + close(done) }() select { case <-done: |