Skip to content

Commit 0868931

Browse files
committed
Add tests for http helper
1 parent 3067795 commit 0868931

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

http/http_test.go

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
package http
2+
3+
import (
4+
"testing"
5+
6+
"github.com/stretchr/testify/assert"
7+
)
8+
9+
func TestIsLocalAddress(t *testing.T) {
10+
assert.False(t, isLocalAddress("216.58.194.206"))
11+
assert.True(t, isLocalAddress("127.0.0.1"))
12+
assert.True(t, isLocalAddress("10.0.0.1"))
13+
assert.True(t, isLocalAddress("192.168.0.1"))
14+
assert.True(t, isLocalAddress("172.16.0.0"))
15+
assert.True(t, isLocalAddress("169.254.169.254"))
16+
}

0 commit comments

Comments
 (0)