/
githubmirror
/
client
Обзор
Документация
Войти
/
githubmirror
/
client
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
go/updater/command/command_unix_test.go
27 строк
745 B
chrisnojima-zoom
Version 670 - clean2 (#29122)
08 июн 2026, 19:31
Не верифицирован
08 июн 2026, 19:31
1943197
Код
Авторство
О чём код?
// Copyright 2016 Keybase, Inc. All rights reserved. Use of // this source code is governed by the included BSD license. //go:build linux || darwin package command import ( "os/exec" "testing" "time" "github.com/stretchr/testify/assert" ) func TestExecWithEnv(t *testing.T) { result, err := execWithFunc("printenv", []string{"TESTENV"}, []string{"TESTENV=ok"}, exec.Command, time.Second, testLog) assert.NoError(t, err) assert.Equal(t, result.Stdout.String(), "ok\n") } func TestExecWithNoEnv(t *testing.T) { // Check there is a PATH env var if we pass nil result, err := execWithFunc("printenv", []string{"PATH"}, nil, exec.Command, time.Second, testLog) assert.NoError(t, err) assert.NotEqual(t, result.Stdout.String(), "") }