Skip to content

Commit

Permalink
Rename tests to help tctest.
Browse files Browse the repository at this point in the history
Acceptance test output:

% go test -v ./aws/internal/net
=== RUN   TestCIDRBlocksEqual
--- PASS: TestCIDRBlocksEqual (0.00s)
=== RUN   TestCanonicalCIDRBlock
--- PASS: TestCanonicalCIDRBlock (0.00s)
PASS
ok  	github.com/terraform-providers/terraform-provider-aws/aws/internal/net	0.687s
  • Loading branch information
ewbankkit committed Jun 15, 2021
1 parent 4579cff commit c2953e4
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions aws/internal/net/cidr_test.go
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
package net
package net_test

import (
"testing"

tfnet "github.com/terraform-providers/terraform-provider-aws/aws/internal/net"
)

func Test_CIDRBlocksEqual(t *testing.T) {
func TestCIDRBlocksEqual(t *testing.T) {
for _, ts := range []struct {
cidr1 string
cidr2 string
Expand All @@ -18,14 +20,14 @@ func Test_CIDRBlocksEqual(t *testing.T) {
{"::/0", "::0/0", true},
{"", "", false},
} {
equal := CIDRBlocksEqual(ts.cidr1, ts.cidr2)
equal := tfnet.CIDRBlocksEqual(ts.cidr1, ts.cidr2)
if ts.equal != equal {
t.Fatalf("CIDRBlocksEqual(%q, %q) should be: %t", ts.cidr1, ts.cidr2, ts.equal)
}
}
}

func Test_CanonicalCIDRBlock(t *testing.T) {
func TestCanonicalCIDRBlock(t *testing.T) {
for _, ts := range []struct {
cidr string
expected string
Expand All @@ -35,7 +37,7 @@ func Test_CanonicalCIDRBlock(t *testing.T) {
{"::0/0", "::/0"},
{"", ""},
} {
got := CanonicalCIDRBlock(ts.cidr)
got := tfnet.CanonicalCIDRBlock(ts.cidr)
if ts.expected != got {
t.Fatalf("CanonicalCIDRBlock(%q) should be: %q, got: %q", ts.cidr, ts.expected, got)
}
Expand Down

0 comments on commit c2953e4

Please sign in to comment.