Debian Codegraph @

storage/2020-08-04/datalakestore/filesystems/helpers_test.go

raw symbols SCIP
1 package filesystemsscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2020-08-04/datalakestore/filesystems`/
2
3 import (
4 "reflectscip-go gomod github.com/golang/go/src go1.13 reflect/"
5 "testingscip-go gomod github.com/golang/go/src go1.13 testing/"
6 )
7
8 func TestParsePropertiesscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2020-08-04/datalakestore/filesystems`/TestParseProperties().(t *testingscip-go gomod github.com/golang/go/src go1.13 testing/.Tscip-go gomod github.com/golang/go/src go1.13 testing/T#) {
9 testData := []struct {
10 name string
11 input string
12 expected map[string]string
13 expectError bool
14 }{
15 {
16 name: "no items",
17 input: "",
18 expected: map[string]string{},
19 expectError: false,
20 },
21 {
22 name: "invalid item",
23 input: "hello",
24 expectError: true,
25 },
26 {
27 name: "single item",
28 input: "hello=world",
29 expected: map[string]string{
30 "hello": "world",
31 },
32 },
33 {
34 name: "single-item-base64",
35 input: "hello=aGVsbG8=",
36 expected: map[string]string{
37 "hello": "aGVsbG8=",
38 },
39 expectError: false,
40 },
41 {
42 name: "single-item-base64-multipleequals",
43 input: "hello=d29uZGVybGFuZA==",
44 expected: map[string]string{
45 "hello": "d29uZGVybGFuZA==",
46 },
47 expectError: false,
48 },
49 {
50 name: "multiple-items-base64",
51 input: "hello=d29uZGVybGFuZA==,private=ZXll",
52
53 expected: map[string]string{
54 "hello": "d29uZGVybGFuZA==",
55 "private": "ZXll",
56 },
57 expectError: false,
58 },
59 }
60
61 for _, testCase := range testData {
62 t.Logfscip-go gomod github.com/golang/go/src go1.13 testing/common#Logf().("[DEBUG] Test %q", testCase.name)
63
64 actual, err := parsePropertiesscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2020-08-04/datalakestore/filesystems`/parseProperties().(testCase.input)
65 if err != nil {
66 if testCase.expectError {
67 continue
68 }
69
70 t.Fatalfscip-go gomod github.com/golang/go/src go1.13 testing/common#Fatalf().("[DEBUG] Didn't expect an error but got %s", err)
71 }
72 if !reflectscip-go gomod github.com/golang/go/src go1.13 reflect/.DeepEqualscip-go gomod github.com/golang/go/src go1.13 reflect/DeepEqual().(testCase.expected, *actual) {
73 t.Fatalfscip-go gomod github.com/golang/go/src go1.13 testing/common#Fatalf().("Expected %+v but got %+v", testCase.expected, *actual)
74 }
75 }
76 }