Skip to content

Commit

Permalink
Fix: Testing tables correctly included in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
leodido committed Dec 11, 2017
1 parent 4d79b5f commit 9d14cd0
Showing 1 changed file with 8 additions and 11 deletions.
19 changes: 8 additions & 11 deletions testingtable.go → tables_test.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
// +build ignore

package urn

import "strconv"

func ierror(index int) string {
return "Test case num. " + strconv.Itoa(index+1)
}

func herror(index int, test testCase) string {
return ierror(index) + ", input \"" + test.in + "\""
}

type testCase struct {
in string // the input
ok bool // whether it is valid or not
Expand All @@ -13,7 +19,6 @@ type testCase struct {
}

var tests = []testCase{

// ok
{"urn:simple:simple", true, &URN{prefix: "urn", ID: "simple", SS: "simple"}, "urn:simple:simple", "urn:simple:simple"},

Expand Down Expand Up @@ -126,14 +131,6 @@ var tests = []testCase{
{"urn:a:", false, nil, "", ""},
}

func ierror(index int) string {
return "Test case num. " + strconv.Itoa(index+1)
}

func herror(index int, test testCase) string {
return ierror(index) + ", input \"" + test.in + "\""
}

var equivalenceTests = []struct {
eq bool
lx string
Expand Down

0 comments on commit 9d14cd0

Please sign in to comment.