aboutsummaryrefslogtreecommitdiffhomepage
path: root/vendor/golang.org/x/oauth2/google/sdk_test.go
diff options
context:
space:
mode:
authorGravatar Frédéric Guillot <fred@miniflux.net>2018-07-06 21:18:14 -0700
committerGravatar Frédéric Guillot <fred@miniflux.net>2018-07-06 21:18:14 -0700
commit459bb4531f92f8663afb6f36aa9be5b789bd591f (patch)
treef14e6c06b8e5c63612d1ff36f8cab40ae8a99d20 /vendor/golang.org/x/oauth2/google/sdk_test.go
parent34a3fe426b33a63f2d8e02d4a70c88f137fa5410 (diff)
Update vendor dependencies
Diffstat (limited to 'vendor/golang.org/x/oauth2/google/sdk_test.go')
-rw-r--r--vendor/golang.org/x/oauth2/google/sdk_test.go63
1 files changed, 62 insertions, 1 deletions
diff --git a/vendor/golang.org/x/oauth2/google/sdk_test.go b/vendor/golang.org/x/oauth2/google/sdk_test.go
index 4489bb9..52b8eca 100644
--- a/vendor/golang.org/x/oauth2/google/sdk_test.go
+++ b/vendor/golang.org/x/oauth2/google/sdk_test.go
@@ -4,7 +4,11 @@
package google
-import "testing"
+import (
+ "reflect"
+ "strings"
+ "testing"
+)
func TestSDKConfig(t *testing.T) {
sdkConfigPath = func() (string, error) {
@@ -44,3 +48,60 @@ func TestSDKConfig(t *testing.T) {
}
}
}
+
+func TestParseINI(t *testing.T) {
+ tests := []struct {
+ ini string
+ want map[string]map[string]string
+ }{
+ {
+ `root = toor
+[foo]
+bar = hop
+ini = nin
+`,
+ map[string]map[string]string{
+ "": {"root": "toor"},
+ "foo": {"bar": "hop", "ini": "nin"},
+ },
+ },
+ {
+ "\t extra \t = whitespace \t\r\n \t [everywhere] \t \r\n here \t = \t there \t \r\n",
+ map[string]map[string]string{
+ "": {"extra": "whitespace"},
+ "everywhere": {"here": "there"},
+ },
+ },
+ {
+ `[empty]
+[section]
+empty=
+`,
+ map[string]map[string]string{
+ "": {},
+ "empty": {},
+ "section": {"empty": ""},
+ },
+ },
+ {
+ `ignore
+[invalid
+=stuff
+;comment=true
+`,
+ map[string]map[string]string{
+ "": {},
+ },
+ },
+ }
+ for _, tt := range tests {
+ result, err := parseINI(strings.NewReader(tt.ini))
+ if err != nil {
+ t.Errorf("parseINI(%q) error %v, want: no error", tt.ini, err)
+ continue
+ }
+ if !reflect.DeepEqual(result, tt.want) {
+ t.Errorf("parseINI(%q) = %#v, want: %#v", tt.ini, result, tt.want)
+ }
+ }
+}