From f5437632f486b7d0a0a181c58f113c86d032b02c Mon Sep 17 00:00:00 2001 From: Christopher Speller Date: Mon, 24 Apr 2017 20:11:36 -0400 Subject: Upgrading server dependancies (#6215) --- .../minio/minio-go/pkg/set/stringset_test.go | 25 ++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'vendor/github.com/minio/minio-go/pkg/set/stringset_test.go') diff --git a/vendor/github.com/minio/minio-go/pkg/set/stringset_test.go b/vendor/github.com/minio/minio-go/pkg/set/stringset_test.go index 4b74e7065..e276fec5a 100644 --- a/vendor/github.com/minio/minio-go/pkg/set/stringset_test.go +++ b/vendor/github.com/minio/minio-go/pkg/set/stringset_test.go @@ -17,6 +17,7 @@ package set import ( + "fmt" "strings" "testing" ) @@ -320,3 +321,27 @@ func TestStringSetString(t *testing.T) { } } } + +// StringSet.ToSlice() is called with series of cases for valid and erroneous inputs and the result is validated. +func TestStringSetToSlice(t *testing.T) { + testCases := []struct { + set StringSet + expectedResult string + }{ + // Test empty set. + {NewStringSet(), `[]`}, + // Test set with empty value. + {CreateStringSet(""), `[]`}, + // Test set with value. + {CreateStringSet("foo"), `[foo]`}, + // Test set with value. + {CreateStringSet("foo", "bar"), `[bar foo]`}, + } + + for _, testCase := range testCases { + sslice := testCase.set.ToSlice() + if str := fmt.Sprintf("%s", sslice); str != testCase.expectedResult { + t.Fatalf("expected: %s, got: %s", testCase.expectedResult, str) + } + } +} -- cgit v1.2.3-1-g7c22