Files
HackBrowserData/cmd/hack-browser-data/helpers_test.go
T
Roger 3e9150249c refactor: rename core types and spell out every name (#677)
Def, Request, DirID, and Source said too little, and short variables and doc comments that skip their name hid intent.
varnamelen and staticcheck ST1020-22 now keep both from coming back.
2026-11-02 11:06:05 +08:00

22 lines
435 B
Go

package main
import (
"testing"
"github.com/spf13/cobra"
"github.com/stretchr/testify/require"
)
// setHome sets USERPROFILE too, because Windows reads it rather than HOME.
func setHome(t *testing.T, home string) {
t.Helper()
t.Setenv("HOME", home)
t.Setenv("USERPROFILE", home)
}
func runCmd(t *testing.T, command *cobra.Command, args ...string) {
t.Helper()
command.SetArgs(args)
require.NoError(t, command.Execute())
}