/
githubmirror
/
client
Обзор
Документация
Войти
/
githubmirror
/
client
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
go/install/install_windows_test.go
45 строк
1 KB
chrisnojima-zoom
Version 670 - clean2 (#29122)
08 июн 2026, 19:31
Не верифицирован
08 июн 2026, 19:31
1943197
Код
Авторство
О чём код?
// Copyright 2015 Keybase, Inc. All rights reserved. Use of // this source code is governed by the included BSD license. //go:build windows package install import ( "os" "path/filepath" "testing" "github.com/keybase/client/go/libkb" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) func TestIsInUse(t *testing.T) { tc := libkb.SetupTest(t, "TestIsInUse", 1) defer tc.Cleanup() // Should be false if no special file is present require.False(t, IsInUse("", tc.G.Log)) tmpdir, err := os.MkdirTemp("", "TestIsInUse") assert.Nil(t, err, "can't create temp tmpdir") signalFileName := filepath.Join(tmpdir, ".kbfs_number_of_handles") // Should be false if special file is empty require.False(t, IsInUse(tmpdir, tc.G.Log)) d := []byte("5") assert.Nil(t, os.WriteFile(signalFileName, d, 0o644)) defer os.Remove(signalFileName) // Should be true if special file has a number require.True(t, IsInUse(tmpdir, tc.G.Log)) d = []byte("0") assert.Nil(t, os.WriteFile(signalFileName, d, 0o644)) // Should be false if special file has a zero require.False(t, IsInUse(tmpdir, tc.G.Log)) }