blob: e4a640e7edd9887147d50da4b1da8c629ba6bd0e (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
|
package sshenv
import (
"testing"
"github.com/stretchr/testify/require"
"gitlab.com/gitlab-org/gitlab-shell/internal/testhelper"
)
func TestLocalAddr(t *testing.T) {
cleanup, err := testhelper.Setenv("SSH_CONNECTION", "127.0.0.1 0")
require.NoError(t, err)
defer cleanup()
require.Equal(t, LocalAddr(), "127.0.0.1")
}
func TestEmptyLocalAddr(t *testing.T) {
require.Equal(t, LocalAddr(), "")
}
|