From 2f4f9697dcf548ca385a03eda952e8a11e3d6d81 Mon Sep 17 00:00:00 2001 From: jspc Date: Sat, 1 Oct 2022 16:24:45 +0100 Subject: [PATCH] Cover lookup where a value is set --- config_test.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/config_test.go b/config_test.go index b470ec4..72062f1 100644 --- a/config_test.go +++ b/config_test.go @@ -1,6 +1,7 @@ package main import ( + "os" "testing" ) @@ -11,6 +12,15 @@ func TestLookup(t *testing.T) { } } +func TestLookup_Exists(t *testing.T) { + os.Setenv("__THIS_KEY_HAS_A_VALUE", "<3") + + got := Lookup("__THIS_KEY_HAS_A_VALUE", "blahblahblah") + if got != "<3" { + t.Errorf("unexpected value %q", got) + } +} + func TestMustLookup(t *testing.T) { defer func() { err := recover()