WIP: cheap scrypt in tests
check / check (push) Successful in 2m52s

This commit is contained in:
2026-10-06 00:20:26 +00:00
parent af9ac6d979
commit 8c82ce628f
6 changed files with 41 additions and 5 deletions
+9
View File
@@ -3,6 +3,7 @@ package vault_test
import (
"bytes"
"errors"
"os"
"path/filepath"
"slices"
"testing"
@@ -28,6 +29,14 @@ const (
testPassphrase = "test-passphrase"
)
// TestMain makes passphrase encryption in the tests cheap; see
// secret.ScryptWorkFactor.
func TestMain(m *testing.M) {
secret.ScryptWorkFactor = 1
os.Exit(m.Run())
}
// testMnemonicBuffer returns testMnemonic in a locked buffer that is
// destroyed when the test ends.
func testMnemonicBuffer(t *testing.T) *memguard.LockedBuffer {