lockbox

password manager
Log | Files | Refs | README | LICENSE

commit 3e8eac170fc70a332691fb36c5c70ec265777be2
parent 3a187525f73dfe49c3522e71ec3da4466d7e6824
Author: Sean Enck <sean@ttypty.com>
Date:   Sun, 11 Aug 2024 11:15:59 -0400

this component of checks is no longer needed with registry func

Diffstat:
Minternal/config/vars_test.go | 29-----------------------------
1 file changed, 0 insertions(+), 29 deletions(-)

diff --git a/internal/config/vars_test.go b/internal/config/vars_test.go @@ -220,37 +220,8 @@ func checkInt(e config.EnvironmentInt, key, text string, def int, allowZero bool } func TestEnvironDefinitions(t *testing.T) { - b, err := os.ReadFile("vars.go") - if err != nil { - t.Errorf("invalid err: %v", err) - } - count := 0 - inVars := false - for _, line := range strings.Split(string(b), "\n") { - if line == "var (" { - inVars = true - continue - } - if inVars { - if strings.Contains(line, "= register(Environment") { - count++ - } else { - if line == ")" { - inVars = false - break - } - } - } - } - if count == 0 || inVars { - t.Errorf("invalid simple parse: %d", count) - } os.Clearenv() vals := config.ListEnvironmentVariables() - if len(vals) != count { - t.Errorf("invalid environment variable info: %d != %d", count, len(vals)) - } - os.Clearenv() expect := make(map[string]struct{}) for _, val := range vals { env := strings.Split(strings.TrimSpace(val), "\n")[0]