Skip to content

Commit

Permalink
Revert "Use gofmt to simplify code"
Browse files Browse the repository at this point in the history
This reverts commit 48dce40.
  • Loading branch information
michaelharo committed Feb 26, 2015
1 parent eb9bd98 commit 6b54d9f
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 22 deletions.
32 changes: 16 additions & 16 deletions labels_test.go
Expand Up @@ -61,9 +61,9 @@ func TestSplit(t *testing.T) {

func TestSplit2(t *testing.T) {
splitter := map[string][]int{
"www.miek.nl.": {0, 4, 9},
"www.miek.nl": {0, 4, 9},
"nl": {0},
"www.miek.nl.": []int{0, 4, 9},
"www.miek.nl": []int{0, 4, 9},
"nl": []int{0},
}
for s, i := range splitter {
x := Split(s)
Expand Down Expand Up @@ -125,13 +125,13 @@ func TestCountLabel(t *testing.T) {

func TestSplitDomainName(t *testing.T) {
labels := map[string][]string{
"miek.nl": {"miek", "nl"},
"miek.nl": []string{"miek", "nl"},
".": nil,
"www.miek.nl.": {"www", "miek", "nl"},
"www.miek.nl": {"www", "miek", "nl"},
"www..miek.nl": {"www", "", "miek", "nl"},
`www\.miek.nl`: {`www\.miek`, "nl"},
`www\\.miek.nl`: {`www\\`, "miek", "nl"},
"www.miek.nl.": []string{"www", "miek", "nl"},
"www.miek.nl": []string{"www", "miek", "nl"},
"www..miek.nl": []string{"www", "", "miek", "nl"},
`www\.miek.nl`: []string{`www\.miek`, "nl"},
`www\\.miek.nl`: []string{`www\\`, "miek", "nl"},
}
domainLoop:
for domain, splits := range labels {
Expand All @@ -155,13 +155,13 @@ func TestIsDomainName(t *testing.T) {
lab int
}
names := map[string]*ret{
"..": {false, 1},
"@.": {true, 1},
"www.example.com": {true, 3},
"www.e%ample.com": {true, 3},
"www.example.com.": {true, 3},
"mi\\k.nl.": {true, 2},
"mi\\k.nl": {true, 2},
"..": &ret{false, 1},
"@.": &ret{true, 1},
"www.example.com": &ret{true, 3},
"www.e%ample.com": &ret{true, 3},
"www.example.com.": &ret{true, 3},
"mi\\k.nl.": &ret{true, 2},
"mi\\k.nl": &ret{true, 2},
}
for d, ok := range names {
l, k := IsDomainName(d)
Expand Down
12 changes: 6 additions & 6 deletions parse_test.go
Expand Up @@ -759,7 +759,7 @@ func TestRfc1982(t *testing.T) {
}

func TestEmpty(t *testing.T) {
for range ParseZone(strings.NewReader(""), "", "") {
for _ = range ParseZone(strings.NewReader(""), "", "") {
t.Errorf("should be empty")
}
}
Expand Down Expand Up @@ -1186,11 +1186,11 @@ func TestNewPrivateKey(t *testing.T) {
t.Skip("skipping test in short mode.")
}
algorithms := []algorithm{
{ECDSAP256SHA256, 256},
{ECDSAP384SHA384, 384},
{RSASHA1, 1024},
{RSASHA256, 2048},
{DSA, 1024},
algorithm{ECDSAP256SHA256, 256},
algorithm{ECDSAP384SHA384, 384},
algorithm{RSASHA1, 1024},
algorithm{RSASHA256, 2048},
algorithm{DSA, 1024},
}

for _, algo := range algorithms {
Expand Down

0 comments on commit 6b54d9f

Please sign in to comment.