mirror of
https://github.com/moonD4rk/HackBrowserData.git
synced 2026-12-04 05:43:27 +01:00
The pipeline goldens now live in app, export in export, and keys.json in masterkey, each with its own testdata; cmd keeps the flag and list goldens. Shared fixtures and golden helpers became the internal/browser/browsertest and internal/golden packages. The binary is byte-identical.
22 lines
460 B
Go
22 lines
460 B
Go
package main
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/spf13/cobra"
|
|
"github.com/stretchr/testify/require"
|
|
)
|
|
|
|
// setHome points the commands' home directory at a fixture: HOME, and USERPROFILE, which Windows reads instead.
|
|
func setHome(t *testing.T, home string) {
|
|
t.Helper()
|
|
t.Setenv("HOME", home)
|
|
t.Setenv("USERPROFILE", home)
|
|
}
|
|
|
|
func runCmd(t *testing.T, cmd *cobra.Command, args ...string) {
|
|
t.Helper()
|
|
cmd.SetArgs(args)
|
|
require.NoError(t, cmd.Execute())
|
|
}
|