1package pwgen
2
3import (
4	"os"
5	"testing"
6
7	"github.com/stretchr/testify/assert"
8)
9
10func TestPwgenExternal(t *testing.T) {
11	_ = os.Setenv("GOPASS_EXTERNAL_PWGEN", "powershell.exe -Command write-output 1234 #")
12	ans, err := GenerateExternal(4)
13	if err != nil {
14		panic("Unable to generate using external generator")
15	}
16	assert.Equal(t, "1234", ans)
17}
18