cloudflare/cloudflared

Public

mirrored from https://github.com/cloudflare/cloudflaredAvailable

CodeCommitsIssuesPull requestsActionsInsightsSecurity
94ca4f98dde5e66ecb475d7f305e8f4cdccbc05c

Branches

Tags

  • No tags available.
0Branches0Tags
Go to file
Add file
Code

Clone

HTTPS

Download ZIP

cmd/cloudflared/access/cmd_test.go

25lines · modecode

1package access
2
3import "testing"
4
5func Test_ensureURLScheme(t *testing.T) {
6 type args struct {
7 url string
8 }
9 tests := []struct {
10 name string
11 args args
12 want string
13 }{
14 {"no scheme", args{"localhost:123"}, "https://localhost:123"},
15 {"http scheme", args{"http://test"}, "https://test"},
16 {"https scheme", args{"https://test"}, "https://test"},
17 }
18 for _, tt := range tests {
19 t.Run(tt.name, func(t *testing.T) {
20 if got := ensureURLScheme(tt.args.url); got != tt.want {
21 t.Errorf("ensureURLScheme() = %v, want %v", got, tt.want)
22 }
23 })
24 }
25}
26