diff --git a/keylock/keylock_test.go b/keylock/keylock_test.go index 12a460c..762a855 100644 --- a/keylock/keylock_test.go +++ b/keylock/keylock_test.go @@ -25,24 +25,24 @@ func TestKeyLock_Simple(t *testing.T) { l := keylock.New() - locked, unlock := l.LockKeys([]string{"a", "b"}, nil) - require.True(t, locked) + canceled, unlock := l.LockKeys([]string{"a", "b"}, nil) + require.False(t, canceled) - locked, _ = l.LockKeys([]string{"", "b", "c"}, timeout(time.Millisecond*10)) - require.False(t, locked) + canceled, _ = l.LockKeys([]string{"", "b", "c"}, timeout(time.Millisecond*10)) + require.True(t, canceled) unlock() - locked, _ = l.LockKeys([]string{"", "b", "c"}, nil) - require.True(t, locked) + canceled, _ = l.LockKeys([]string{"", "b", "c"}, nil) + require.False(t, canceled) } func TestKeyLock_Progress(t *testing.T) { defer goleak.VerifyNone(t) l := keylock.New() - locked, unlock := l.LockKeys([]string{"a", "b"}, nil) - require.True(t, locked) + canceled, unlock := l.LockKeys([]string{"a", "b"}, nil) + require.False(t, canceled) defer unlock() go func() { @@ -50,8 +50,8 @@ func TestKeyLock_Progress(t *testing.T) { }() time.Sleep(time.Millisecond * 10) - locked, _ = l.LockKeys([]string{"d"}, nil) - require.True(t, locked) + canceled, _ = l.LockKeys([]string{"d"}, nil) + require.False(t, canceled) } func TestKeyLock_DeadlockFree(t *testing.T) {