From 2a5b2f2f4a21c77d9b7f518d0607875d8af220c8 Mon Sep 17 00:00:00 2001
From: Christian Couder <chriscool@tuxfamily.org>
Date: Sat, 2 May 2015 22:35:10 +0200
Subject: [PATCH] parse_test: move helper functions

License: MIT
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
---
 commands/cli/parse_test.go | 48 +++++++++++++++++++-------------------
 1 file changed, 24 insertions(+), 24 deletions(-)

diff --git a/commands/cli/parse_test.go b/commands/cli/parse_test.go
index edbca7f76..a1fbe13a3 100644
--- a/commands/cli/parse_test.go
+++ b/commands/cli/parse_test.go
@@ -7,6 +7,30 @@ import (
 	"github.com/ipfs/go-ipfs/commands"
 )
 
+type kvs map[string]interface{}
+type words []string
+
+func sameWords(a words, b words) bool {
+	for i, w := range a {
+		if w != b[i] {
+			return false
+		}
+	}
+	return true
+}
+
+func sameKVs(a kvs, b kvs) bool {
+	if len(a) != len(b) {
+		return false
+	}
+	for k, v := range a {
+		if v != b[k] {
+			return false
+		}
+	}
+	return true
+}
+
 func TestOptionParsing(t *testing.T) {
 	subCmd := &commands.Command{}
 	cmd := &commands.Command{
@@ -19,30 +43,6 @@ func TestOptionParsing(t *testing.T) {
 		},
 	}
 
-	type kvs map[string]interface{}
-	type words []string
-
-	sameWords := func(a words, b words) bool {
-		for i, w := range a {
-			if w != b[i] {
-				return false
-			}
-		}
-		return true
-	}
-
-	sameKVs := func(a kvs, b kvs) bool {
-		if len(a) != len(b) {
-			return false
-		}
-		for k, v := range a {
-			if v != b[k] {
-				return false
-			}
-		}
-		return true
-	}
-
 	testHelper := func(args string, expectedOpts kvs, expectedWords words, expectErr bool) {
 		_, opts, input, _, err := parseOpts(strings.Split(args, " "), cmd)
 		if expectErr {
-- 
GitLab