diff options
Diffstat (limited to 'go/internal/config/config_test.go')
-rw-r--r-- | go/internal/config/config_test.go | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/go/internal/config/config_test.go b/go/internal/config/config_test.go index e31ff70..1dfee28 100644 --- a/go/internal/config/config_test.go +++ b/go/internal/config/config_test.go @@ -2,6 +2,7 @@ package config import ( "fmt" + "os" "path" "testing" @@ -110,3 +111,10 @@ func TestParseConfig(t *testing.T) { }) } } + +func TestGetIPAddr(t *testing.T) { + err := os.Setenv("SSH_CONNECTION", "127.0.0.1 0") + + require.Nil(t, err) + require.Equal(t, getIPAddr(), "127.0.0.1") +} |