@@ -17,6 +17,7 @@ import (
17
17
func TestParseTunnelFlags (t * testing.T ) {
18
18
19
19
tests := []struct {
20
+ tunnelType string
20
21
verbose bool
21
22
insecure bool
22
23
detach bool
@@ -31,6 +32,7 @@ func TestParseTunnelFlags(t *testing.T) {
31
32
timeout string
32
33
}{
33
34
{
35
+ "local" ,
34
36
true ,
35
37
true ,
36
38
true ,
@@ -45,6 +47,7 @@ func TestParseTunnelFlags(t *testing.T) {
45
47
"1m0s" ,
46
48
},
47
49
{
50
+ "local" ,
48
51
true ,
49
52
false ,
50
53
true ,
@@ -62,6 +65,7 @@ func TestParseTunnelFlags(t *testing.T) {
62
65
63
66
for id , test := range tests {
64
67
ai := & alias.Alias {
68
+ TunnelType : test .tunnelType ,
65
69
Verbose : test .verbose ,
66
70
Insecure : test .insecure ,
67
71
Detach : test .detach ,
@@ -81,58 +85,62 @@ func TestParseTunnelFlags(t *testing.T) {
81
85
t .Errorf ("%v\n " , err )
82
86
}
83
87
88
+ if test .tunnelType != tf .TunnelType {
89
+ t .Errorf ("tunnelType doesn't match on test %d: expected: %s, value: %s" , id , test .tunnelType , tf .TunnelType )
90
+ }
91
+
84
92
if test .verbose != tf .Verbose {
85
- t .Errorf ("verbose doesn't match for test %d: expected: %t, value: %t" , id , test .verbose , tf .Verbose )
93
+ t .Errorf ("verbose doesn't match on test %d: expected: %t, value: %t" , id , test .verbose , tf .Verbose )
86
94
}
87
95
88
96
if test .insecure != tf .Insecure {
89
- t .Errorf ("insecure doesn't match for test %d: expected: %t, value: %t" , id , test .insecure , tf .Insecure )
97
+ t .Errorf ("insecure doesn't match on test %d: expected: %t, value: %t" , id , test .insecure , tf .Insecure )
90
98
}
91
99
92
100
if test .detach != tf .Detach {
93
- t .Errorf ("detach doesn't match for test %d: expected: %t, value: %t" , id , test .detach , tf .Detach )
101
+ t .Errorf ("detach doesn't match on test %d: expected: %t, value: %t" , id , test .detach , tf .Detach )
94
102
}
95
103
96
104
for i , tsrc := range test .source {
97
105
src := tf .Source [i ].String ()
98
106
if tsrc != src {
99
- t .Errorf ("source %d doesn't match for test %d: expected: %s, value: %s" , id , i , tsrc , src )
107
+ t .Errorf ("source %d doesn't match on test %d: expected: %s, value: %s" , id , i , tsrc , src )
100
108
}
101
109
}
102
110
103
111
for i , tdst := range test .destination {
104
112
dst := tf .Destination [i ].String ()
105
113
if tdst != dst {
106
- t .Errorf ("destination %d doesn't match for test %d: expected: %s, value: %s" , id , i , tdst , dst )
114
+ t .Errorf ("destination %d doesn't match on test %d: expected: %s, value: %s" , id , i , tdst , dst )
107
115
}
108
116
}
109
117
110
118
if test .server != tf .Server .String () {
111
- t .Errorf ("server doesn't match for test %d: expected: %s, value: %s" , id , test .server , tf .Server .String ())
119
+ t .Errorf ("server doesn't match on test %d: expected: %s, value: %s" , id , test .server , tf .Server .String ())
112
120
}
113
121
114
122
if test .key != tf .Key {
115
- t .Errorf ("key doesn't match for test %d: expected: %s, value: %s" , id , test .key , tf .Key )
123
+ t .Errorf ("key doesn't match on test %d: expected: %s, value: %s" , id , test .key , tf .Key )
116
124
}
117
125
118
126
if test .keepAliveInterval != tf .KeepAliveInterval .String () {
119
- t .Errorf ("keepAliveInterval doesn't match for test %d: expected: %s, value: %s" , id , test .keepAliveInterval , tf .KeepAliveInterval .String ())
127
+ t .Errorf ("keepAliveInterval doesn't match on test %d: expected: %s, value: %s" , id , test .keepAliveInterval , tf .KeepAliveInterval .String ())
120
128
}
121
129
122
130
if test .connectionRetries != tf .ConnectionRetries {
123
- t .Errorf ("connectionRetries doesn't match for test %d: expected: %d, value: %d" , id , test .connectionRetries , tf .ConnectionRetries )
131
+ t .Errorf ("connectionRetries doesn't match on test %d: expected: %d, value: %d" , id , test .connectionRetries , tf .ConnectionRetries )
124
132
}
125
133
126
134
if test .waitAndRetry != tf .WaitAndRetry .String () {
127
- t .Errorf ("waitAndRetry doesn't match for test %d: expected: %s, value: %s" , id , test .waitAndRetry , tf .WaitAndRetry .String ())
135
+ t .Errorf ("waitAndRetry doesn't match on test %d: expected: %s, value: %s" , id , test .waitAndRetry , tf .WaitAndRetry .String ())
128
136
}
129
137
130
138
if test .sshAgent != tf .SshAgent {
131
- t .Errorf ("sshAgent doesn't match for test %d: expected: %s, value: %s" , id , test .sshAgent , tf .SshAgent )
139
+ t .Errorf ("sshAgent doesn't match on test %d: expected: %s, value: %s" , id , test .sshAgent , tf .SshAgent )
132
140
}
133
141
134
142
if test .timeout != tf .Timeout .String () {
135
- t .Errorf ("timeout doesn't match for test %d: expected: %s, value: %s" , id , test .timeout , tf .Timeout .String ())
143
+ t .Errorf ("timeout doesn't match on test %d: expected: %s, value: %s" , id , test .timeout , tf .Timeout .String ())
136
144
}
137
145
138
146
}
0 commit comments