Skip to content

Commit 8693bee

Browse files
committed
nat: fix camel-casing of vars in tests
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
1 parent 9d517c1 commit 8693bee

1 file changed

Lines changed: 26 additions & 26 deletions

File tree

nat/nat_test.go

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ func TestSplitProtoPort(t *testing.T) {
190190
expProto: "tcp",
191191
},
192192
{
193-
doc: "port range with emptyprotocol",
193+
doc: "port range with empty protocol",
194194
input: "80-8080/",
195195
expPort: "80-8080",
196196
expProto: "tcp",
@@ -379,17 +379,17 @@ func TestParsePortSpecs(t *testing.T) {
379379
t.Fatal("3456/sctp was not parsed properly")
380380
}
381381

382-
for portspec, bindings := range bindingMap {
382+
for portSpec, bindings := range bindingMap {
383383
if len(bindings) != 1 {
384-
t.Fatalf("%s should have exactly one binding", portspec)
384+
t.Fatalf("%s should have exactly one binding", portSpec)
385385
}
386386

387387
if bindings[0].HostIP != "" {
388-
t.Fatalf("HostIP should not be set for %s", portspec)
388+
t.Fatalf("HostIP should not be set for %s", portSpec)
389389
}
390390

391391
if bindings[0].HostPort != "" {
392-
t.Fatalf("HostPort should not be set for %s", portspec)
392+
t.Fatalf("HostPort should not be set for %s", portSpec)
393393
}
394394
}
395395

@@ -410,19 +410,19 @@ func TestParsePortSpecs(t *testing.T) {
410410
t.Fatal("3456/sctp was not parsed properly")
411411
}
412412

413-
for portspec, bindings := range bindingMap {
414-
_, port := SplitProtoPort(string(portspec))
413+
for portSpec, bindings := range bindingMap {
414+
_, port := SplitProtoPort(string(portSpec))
415415

416416
if len(bindings) != 1 {
417-
t.Fatalf("%s should have exactly one binding", portspec)
417+
t.Fatalf("%s should have exactly one binding", portSpec)
418418
}
419419

420420
if bindings[0].HostIP != "" {
421-
t.Fatalf("HostIP should not be set for %s", portspec)
421+
t.Fatalf("HostIP should not be set for %s", portSpec)
422422
}
423423

424424
if bindings[0].HostPort != port {
425-
t.Fatalf("HostPort should be %s for %s", port, portspec)
425+
t.Fatalf("HostPort should be %s for %s", port, portSpec)
426426
}
427427
}
428428

@@ -443,19 +443,19 @@ func TestParsePortSpecs(t *testing.T) {
443443
t.Fatal("3456/sctp was not parsed properly")
444444
}
445445

446-
for portspec, bindings := range bindingMap {
447-
_, port := SplitProtoPort(string(portspec))
446+
for portSpec, bindings := range bindingMap {
447+
_, port := SplitProtoPort(string(portSpec))
448448

449449
if len(bindings) != 1 {
450-
t.Fatalf("%s should have exactly one binding", portspec)
450+
t.Fatalf("%s should have exactly one binding", portSpec)
451451
}
452452

453453
if bindings[0].HostIP != "0.0.0.0" {
454-
t.Fatalf("HostIP is not 0.0.0.0 for %s", portspec)
454+
t.Fatalf("HostIP is not 0.0.0.0 for %s", portSpec)
455455
}
456456

457457
if bindings[0].HostPort != port {
458-
t.Fatalf("HostPort should be %s for %s", port, portspec)
458+
t.Fatalf("HostPort should be %s for %s", port, portSpec)
459459
}
460460
}
461461

@@ -490,17 +490,17 @@ func TestParsePortSpecsWithRange(t *testing.T) {
490490
t.Fatal("3456/sctp was not parsed properly")
491491
}
492492

493-
for portspec, bindings := range bindingMap {
493+
for portSpec, bindings := range bindingMap {
494494
if len(bindings) != 1 {
495-
t.Fatalf("%s should have exactly one binding", portspec)
495+
t.Fatalf("%s should have exactly one binding", portSpec)
496496
}
497497

498498
if bindings[0].HostIP != "" {
499-
t.Fatalf("HostIP should not be set for %s", portspec)
499+
t.Fatalf("HostIP should not be set for %s", portSpec)
500500
}
501501

502502
if bindings[0].HostPort != "" {
503-
t.Fatalf("HostPort should not be set for %s", portspec)
503+
t.Fatalf("HostPort should not be set for %s", portSpec)
504504
}
505505
}
506506

@@ -521,18 +521,18 @@ func TestParsePortSpecsWithRange(t *testing.T) {
521521
t.Fatal("3456/sctp was not parsed properly")
522522
}
523523

524-
for portspec, bindings := range bindingMap {
525-
_, port := SplitProtoPort(string(portspec))
524+
for portSpec, bindings := range bindingMap {
525+
_, port := SplitProtoPort(string(portSpec))
526526
if len(bindings) != 1 {
527-
t.Fatalf("%s should have exactly one binding", portspec)
527+
t.Fatalf("%s should have exactly one binding", portSpec)
528528
}
529529

530530
if bindings[0].HostIP != "" {
531-
t.Fatalf("HostIP should not be set for %s", portspec)
531+
t.Fatalf("HostIP should not be set for %s", portSpec)
532532
}
533533

534534
if bindings[0].HostPort != port {
535-
t.Fatalf("HostPort should be %s for %s", port, portspec)
535+
t.Fatalf("HostPort should be %s for %s", port, portSpec)
536536
}
537537
}
538538

@@ -553,8 +553,8 @@ func TestParsePortSpecsWithRange(t *testing.T) {
553553
t.Fatal("3456/sctp was not parsed properly")
554554
}
555555

556-
for portspec, bindings := range bindingMap {
557-
_, port := SplitProtoPort(string(portspec))
556+
for portSpec, bindings := range bindingMap {
557+
_, port := SplitProtoPort(string(portSpec))
558558
if len(bindings) != 1 || bindings[0].HostIP != "0.0.0.0" || bindings[0].HostPort != port {
559559
t.Fatalf("Expect single binding to port %s but found %s", port, bindings)
560560
}

0 commit comments

Comments
 (0)