@@ -10,7 +10,7 @@ import (
10
10
11
11
var contentStore * ContentStore
12
12
13
- func TestContenStorePut (t * testing.T ) {
13
+ func TestContentStorePut (t * testing.T ) {
14
14
setup ()
15
15
defer teardown ()
16
16
@@ -31,7 +31,7 @@ func TestContenStorePut(t *testing.T) {
31
31
}
32
32
}
33
33
34
- func TestContenStorePutHashMismatch (t * testing.T ) {
34
+ func TestContentStorePutHashMismatch (t * testing.T ) {
35
35
setup ()
36
36
defer teardown ()
37
37
@@ -52,7 +52,7 @@ func TestContenStorePutHashMismatch(t *testing.T) {
52
52
}
53
53
}
54
54
55
- func TestContenStorePutSizeMismatch (t * testing.T ) {
55
+ func TestContentStorePutSizeMismatch (t * testing.T ) {
56
56
setup ()
57
57
defer teardown ()
58
58
@@ -73,7 +73,7 @@ func TestContenStorePutSizeMismatch(t *testing.T) {
73
73
}
74
74
}
75
75
76
- func TestContenStoreGet (t * testing.T ) {
76
+ func TestContentStoreGet (t * testing.T ) {
77
77
setup ()
78
78
defer teardown ()
79
79
@@ -91,6 +91,8 @@ func TestContenStoreGet(t *testing.T) {
91
91
r , err := contentStore .Get (m , 0 )
92
92
if err != nil {
93
93
t .Fatalf ("expected get to succeed, got: %s" , err )
94
+ } else {
95
+ defer r .Close ()
94
96
}
95
97
96
98
by , _ := ioutil .ReadAll (r )
@@ -99,7 +101,7 @@ func TestContenStoreGet(t *testing.T) {
99
101
}
100
102
}
101
103
102
- func TestContenStoreGetWithRange (t * testing.T ) {
104
+ func TestContentStoreGetWithRange (t * testing.T ) {
103
105
setup ()
104
106
defer teardown ()
105
107
@@ -117,6 +119,8 @@ func TestContenStoreGetWithRange(t *testing.T) {
117
119
r , err := contentStore .Get (m , 5 )
118
120
if err != nil {
119
121
t .Fatalf ("expected get to succeed, got: %s" , err )
122
+ } else {
123
+ defer r .Close ()
120
124
}
121
125
122
126
by , _ := ioutil .ReadAll (r )
@@ -135,7 +139,7 @@ func TestContenStoreGetNonExisting(t *testing.T) {
135
139
}
136
140
}
137
141
138
- func TestContenStoreExists (t * testing.T ) {
142
+ func TestContentStoreExists (t * testing.T ) {
139
143
setup ()
140
144
defer teardown ()
141
145
0 commit comments