lockbox

password manager
Log | Files | Refs | README | LICENSE

commit 649f97ee18ba6b720d2490abdb35238e2cea1a15
parent fc802a2793e58efc7f699fa942ed6a60985a99ac
Author: Sean Enck <sean@ttypty.com>
Date:   Fri,  6 Dec 2024 20:10:51 -0500

these tests should rely on the same count

Diffstat:
Minternal/config/toml_test.go | 3++-
Minternal/config/vars_test.go | 4+++-
2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/internal/config/toml_test.go b/internal/config/toml_test.go @@ -276,7 +276,8 @@ func TestDefaultTOMLToLoadFile(t *testing.T) { count++ } } - if count != 31 { + // NOTE: this is one less than available because the default config itself is not configurable...via the config + if count != expectEnv-1 { t.Errorf("invalid environment after load: %d", count) } } diff --git a/internal/config/vars_test.go b/internal/config/vars_test.go @@ -9,6 +9,8 @@ import ( "github.com/seanenck/lockbox/internal/config" ) +const expectEnv = 32 + func checkYesNo(key string, t *testing.T, obj config.EnvironmentBool, onEmpty bool) { t.Setenv(key, "yes") c, err := obj.Get() @@ -105,7 +107,7 @@ func TestListVariables(t *testing.T) { known[trim] = struct{}{} } l := len(known) - if l != 32 { + if l != expectEnv { t.Errorf("invalid env count, outdated? %d", l) } }