summaryrefslogtreecommitdiff
path: root/spew/spew_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'spew/spew_test.go')
-rw-r--r--spew/spew_test.go25
1 files changed, 25 insertions, 0 deletions
diff --git a/spew/spew_test.go b/spew/spew_test.go
index d2d620e..406edc1 100644
--- a/spew/spew_test.go
+++ b/spew/spew_test.go
@@ -25,6 +25,31 @@ import (
"testing"
)
+// stringizeWants converts a slice of wanted test output into a format suitable
+// for an test error message.
+func stringizeWants(wants []string) string {
+ s := ""
+ for i, want := range wants {
+ if i > 0 {
+ s += fmt.Sprintf("want%d: %s", i+1, want)
+ } else {
+ s += "want: " + want
+ }
+ }
+ return s
+}
+
+// testFailed returns whether or not a test failed by checking if the result
+// of the test is in the slice of wanted strings.
+func testFailed(result string, wants []string) bool {
+ for _, want := range wants {
+ if result == want {
+ return false
+ }
+ }
+ return true
+}
+
// spewFunc is used to identify which public function of the spew package or
// ConfigState a test applies to.
type spewFunc int