1
0
mirror of https://github.com/gluster/glusterd2.git synced 2026-02-05 12:45:38 +01:00
Files
glusterd2/pkg/utils/mutex_test.go
Madhu Rajanna b45382e877 pkg:utils unit test
added unit test for pkgs/utils

Signed-off-by: Madhu Rajanna <mrajanna@redhat.com>
2018-04-26 15:46:30 +05:30

17 lines
240 B
Go

package utils
import "testing"
import "github.com/stretchr/testify/assert"
func TestTryLock(t *testing.T) {
lock := MutexWithTry{}
defer lock.Unlock()
l := lock.TryLock()
assert.True(t, l)
l = lock.TryLock()
assert.False(t, l)
}