@@ -160,17 +160,21 @@ func TestLoadDataset(t *testing.T) {
160160 "some/path/structure5_target.pdb\n " +
161161 "some/path/structure5something_r_u.pdb\n " +
162162 "some/path/structure5something_l_u.pdb\n " +
163- "some/path/structure5something_target.pdb\n " ), 0644 )
163+ "some/path/structure5something_target.pdb\n " +
164+ "some/path/structure6_r_u.pdb\n " +
165+ "some/path/structure6_l_u.pdb\n " +
166+ "some/path/structure6_shape.pdb\n " ), 0644 )
167+
164168 defer os .Remove ("pdb.list" )
165169
166170 // Pass by loading a valid dataset
167171
168- tArr , errData := LoadDataset (projectDir , "pdb.list" , "_r_u" , "_l_u" , "" )
172+ tArr , errData := LoadDataset (projectDir , "pdb.list" , "_r_u" , "_l_u" , "_shape " )
169173 if errData != nil {
170174 t .Errorf ("Failed to load dataset: %s" , err .Error ())
171175 }
172176
173- if len (tArr ) != 6 {
177+ if len (tArr ) != 7 {
174178 t .Errorf ("Failed to load dataset: %d" , len (tArr ))
175179 }
176180
@@ -189,6 +193,9 @@ func TestLoadDataset(t *testing.T) {
189193 t .Errorf ("Failed: Not all toppar files were loaded" )
190194 }
191195 }
196+ if len (v .Shape ) != 0 {
197+ t .Errorf ("Failed: Shape wrongly loaded" )
198+ }
192199 }
193200 if v .ID == "structure3" {
194201 if len (v .Receptor ) != 3 {
@@ -200,6 +207,23 @@ func TestLoadDataset(t *testing.T) {
200207 t .Errorf ("Failed: More than one miscpdb was loaded" )
201208 }
202209 }
210+ if v .ID == "structure6" {
211+ if len (v .Shape ) != 1 {
212+ t .Errorf ("Failed: Shape not identified" )
213+ }
214+ }
215+ }
216+
217+ // Pass by not loading an empty shape
218+ tArr , errData = LoadDataset (projectDir , "pdb.list" , "_r_u" , "_l_u" , "" )
219+ if errData != nil {
220+ t .Errorf ("Failed to load dataset: %s" , err .Error ())
221+ }
222+
223+ for _ , v := range tArr {
224+ if len (v .Shape ) != 0 {
225+ t .Error ("Failed: Shape wrongly loaded" )
226+ }
203227 }
204228
205229 // Fail by loading a dataset with a wrong file
0 commit comments