Skip to content

Commit

Permalink
Add error test case
Browse files Browse the repository at this point in the history
  • Loading branch information
matsuyoshi30 committed Nov 25, 2020
1 parent a01027f commit f712d6b
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions main_test.go
Expand Up @@ -325,6 +325,33 @@ func TestMakeOptions(t *testing.T) {
},
wantErr: false,
},
{
name: "wrong format",
cli: &cli{
method: "GET",
resolvers: "1.2.3.4:1:1",
},
want: nil,
wantErr: true,
},
{
name: "wrong IP address",
cli: &cli{
method: "GET",
resolvers: "1111.2.3.4",
},
want: nil,
wantErr: true,
},
{
name: "wrong port number",
cli: &cli{
method: "GET",
resolvers: "192.168.11.1:65536",
},
want: nil,
wantErr: true,
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
Expand Down

0 comments on commit f712d6b

Please sign in to comment.