Commit 4bab8e2 1 parent 676c504 commit 4bab8e2 Copy full SHA for 4bab8e2
File tree 1 file changed +7
-1
lines changed
1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change 7
7
func TestClone (t * testing.T ) {
8
8
c := new (Config )
9
9
c .Identity .PeerID = "faketest"
10
- c .API .HTTPHeaders = map [string ][]string {"foo" : [] string {"bar" }}
10
+ c .API .HTTPHeaders = map [string ][]string {"foo" : {"bar" }}
11
11
12
12
newCfg , err := c .Clone ()
13
13
if err != nil {
@@ -16,6 +16,12 @@ func TestClone(t *testing.T) {
16
16
if newCfg .Identity .PeerID != c .Identity .PeerID {
17
17
t .Fatal ("peer ID not preserved" )
18
18
}
19
+
20
+ c .API .HTTPHeaders ["foo" ] = []string {"baz" }
21
+ if newCfg .API .HTTPHeaders ["foo" ][0 ] != "bar" {
22
+ t .Fatal ("HTTP headers not preserved" )
23
+ }
24
+
19
25
delete (c .API .HTTPHeaders , "foo" )
20
26
if newCfg .API .HTTPHeaders ["foo" ][0 ] != "bar" {
21
27
t .Fatal ("HTTP headers not preserved" )
You can’t perform that action at this time.
0 commit comments