summaryrefslogtreecommitdiff
path: root/pkg/network/subnet_test.go
diff options
context:
space:
mode:
authorValentin Rothberg <rothberg@redhat.com>2020-01-14 09:53:02 +0100
committerValentin Rothberg <rothberg@redhat.com>2020-01-14 10:51:59 +0100
commitcf1f3191d2be691b482ac86f9476c180f608ddbe (patch)
tree16b5c74883be69aef8e567bc089b3656b6fb14fa /pkg/network/subnet_test.go
parenta1028697465029f3e7b100de843eb7e5e2948246 (diff)
downloadpodman-cf1f3191d2be691b482ac86f9476c180f608ddbe.tar.gz
podman-cf1f3191d2be691b482ac86f9476c180f608ddbe.tar.bz2
podman-cf1f3191d2be691b482ac86f9476c180f608ddbe.zip
make lint: include unit tests
Include the unit tests (i.e., _test.go files) for linting to make the tests more robust and enforce the linters' coding styles etc. Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
Diffstat (limited to 'pkg/network/subnet_test.go')
-rw-r--r--pkg/network/subnet_test.go13
1 files changed, 7 insertions, 6 deletions
diff --git a/pkg/network/subnet_test.go b/pkg/network/subnet_test.go
index 6ecfd2d17..917c3be88 100644
--- a/pkg/network/subnet_test.go
+++ b/pkg/network/subnet_test.go
@@ -20,14 +20,15 @@ func TestNextSubnet(t *testing.T) {
{"class c", args{subnet: parseCIDR("192.168.1.0/24")}, parseCIDR("192.168.2.0/24"), false},
}
for _, tt := range tests {
- t.Run(tt.name, func(t *testing.T) {
- got, err := NextSubnet(tt.args.subnet)
- if (err != nil) != tt.wantErr {
- t.Errorf("NextSubnet() error = %v, wantErr %v", err, tt.wantErr)
+ test := tt
+ t.Run(test.name, func(t *testing.T) {
+ got, err := NextSubnet(test.args.subnet)
+ if (err != nil) != test.wantErr {
+ t.Errorf("NextSubnet() error = %v, wantErr %v", err, test.wantErr)
return
}
- if !reflect.DeepEqual(got, tt.want) {
- t.Errorf("NextSubnet() got = %v, want %v", got, tt.want)
+ if !reflect.DeepEqual(got, test.want) {
+ t.Errorf("NextSubnet() got = %v, want %v", got, test.want)
}
})
}