@@ -18,7 +18,7 @@ import (
18
18
)
19
19
20
20
func TestObjectParse (t * testing.T ) {
21
- lb := cidlink.LinkPrototype {cid.Prefix {
21
+ lb := cidlink.LinkPrototype {Prefix : cid.Prefix {
22
22
Version : 1 ,
23
23
Codec : cid .GitRaw ,
24
24
MhType : 0x11 ,
@@ -93,7 +93,7 @@ func TestObjectParse(t *testing.T) {
93
93
}
94
94
95
95
func TestArchiveObjectParse (t * testing.T ) {
96
- lb := cidlink.LinkPrototype {cid.Prefix {
96
+ lb := cidlink.LinkPrototype {Prefix : cid.Prefix {
97
97
Version : 1 ,
98
98
Codec : cid .GitRaw ,
99
99
MhType : 0x11 ,
@@ -201,25 +201,25 @@ func testNode(t *testing.T, nd ipld.Node) error {
201
201
t .Fatalf ("Commit is not a commit" )
202
202
}
203
203
204
- assert (t , ! commit .GitTree .IsNull ())
204
+ assert (t , ! commit .tree .IsNull ())
205
205
case Type .Tag :
206
206
tag , ok := nd .(Tag )
207
207
if ! ok {
208
208
t .Fatalf ("Tag is not a tag" )
209
209
}
210
210
211
- tt , err := tag .TagType .AsString ()
211
+ tt , err := tag .tagType .AsString ()
212
212
assert (t , err == nil )
213
213
assert (t , tt == "commit" || tt == "tree" || tt == "blob" || tt == "tag" )
214
- assert (t , ! tag .Object .IsNull ())
214
+ assert (t , ! tag .object .IsNull ())
215
215
216
216
case Type .Tree :
217
217
tree , ok := nd .(Tree )
218
218
if ! ok {
219
219
t .Fatalf ("Tree is not a tree" )
220
220
}
221
221
222
- assert (t , len (tree .x ) > 0 )
222
+ assert (t , len (tree .m ) > 0 )
223
223
}
224
224
return nil
225
225
}
@@ -234,25 +234,25 @@ func TestParsePersonInfo(t *testing.T) {
234
234
t .Fatal ("not equal:" , string (p1 ), "vs: " , pi .GitString ())
235
235
}
236
236
237
- if d , err := pi .LookupByString ("Date " ); err != nil {
237
+ if d , err := pi .LookupByString ("date " ); err != nil {
238
238
t .Fatalf ("invalid date, got %s\n " , err )
239
239
} else if ds , _ := d .AsString (); ds != "123456" {
240
240
t .Fatalf ("invalid date, got %s\n " , ds )
241
241
}
242
242
243
- if d , err := pi .LookupByString ("Timezone " ); err != nil {
243
+ if d , err := pi .LookupByString ("timezone " ); err != nil {
244
244
t .Fatalf ("invalid timezone, got %s\n " , err )
245
245
} else if ds , _ := d .AsString (); ds != "+0123" {
246
246
t .Fatalf ("invalid timezone, got %s\n " , ds )
247
247
}
248
248
249
- if d , err := pi .LookupByString ("Email " ); err != nil {
249
+ if d , err := pi .LookupByString ("email " ); err != nil {
250
250
t .Fatalf ("invalid email, got %s\n " , err )
251
251
}
else if ds ,
_ := d .
AsString ();
ds != "[email protected] " {
252
252
t .Fatalf ("invalid email, got %s\n " , ds )
253
253
}
254
254
255
- if d , err := pi .LookupByString ("Name " ); err != nil {
255
+ if d , err := pi .LookupByString ("name " ); err != nil {
256
256
t .Fatalf ("invalid name, got %s\n " , err )
257
257
} else if ds , _ := d .AsString (); ds != "Someone" {
258
258
t .Fatalf ("invalid name, got %s\n " , ds )
@@ -267,7 +267,7 @@ func TestParsePersonInfo(t *testing.T) {
267
267
t .Fatal ("not equal" , p2 , pi .GitString ())
268
268
}
269
269
270
- if d , err := pi .LookupByString ("Name " ); err != nil {
270
+ if d , err := pi .LookupByString ("name " ); err != nil {
271
271
t .Fatalf ("invalid name, got %s\n " , err )
272
272
} else if ds , _ := d .AsString (); ds != "So Me One" {
273
273
t .Fatalf ("invalid name, got %s\n " , ds )
@@ -281,25 +281,25 @@ func TestParsePersonInfo(t *testing.T) {
281
281
if ! bytes .Equal ([]byte (pi .GitString ()), p3 [7 :]) {
282
282
t .Fatal ("not equal" , p3 , pi .GitString ())
283
283
}
284
- if d , err := pi .LookupByString ("Date " ); err != nil {
284
+ if d , err := pi .LookupByString ("date " ); err != nil {
285
285
t .Fatalf ("invalid date, got %s\n " , err )
286
286
} else if ds , _ := d .AsString (); ds != "987654" {
287
287
t .Fatalf ("invalid date, got %s\n " , ds )
288
288
}
289
289
290
- if d , err := pi .LookupByString ("Timezone " ); err != nil {
290
+ if d , err := pi .LookupByString ("timezone " ); err != nil {
291
291
t .Fatalf ("invalid tz, got %s\n " , err )
292
292
} else if ds , _ := d .AsString (); ds != "+4321" {
293
293
t .Fatalf ("invalid tz, got %s\n " , ds )
294
294
}
295
295
296
- if d , err := pi .LookupByString ("Email " ); err != nil {
296
+ if d , err := pi .LookupByString ("email " ); err != nil {
297
297
t .Fatalf ("invalid email, got %s\n " , err )
298
298
}
else if ds ,
_ := d .
AsString ();
ds != "[email protected] , [email protected] " {
299
299
t .Fatalf ("invalid email, got %s\n " , ds )
300
300
}
301
301
302
- if d , err := pi .LookupByString ("Name " ); err != nil {
302
+ if d , err := pi .LookupByString ("name " ); err != nil {
303
303
t .Fatalf ("invalid name, got %s\n " , err )
304
304
} else if ds , _ := d .AsString (); ds != "Some One & Other One" {
305
305
t .Fatalf ("invalid name, got %s\n " , ds )
@@ -314,25 +314,25 @@ func TestParsePersonInfo(t *testing.T) {
314
314
t .Fatal ("not equal" , p4 , pi .GitString ())
315
315
}
316
316
317
- if d , err := pi .LookupByString ("Name " ); err != nil {
317
+ if d , err := pi .LookupByString ("name " ); err != nil {
318
318
t .Fatalf ("invalid name, got %s\n " , err )
319
319
} else if ds , _ := d .AsString (); ds != "" {
320
320
t .Fatalf ("invalid name, got %s\n " , ds )
321
321
}
322
322
323
- if d , err := pi .LookupByString ("Email " ); err != nil {
323
+ if d , err := pi .LookupByString ("email " ); err != nil {
324
324
t .Fatalf ("invalid email, got %s\n " , err )
325
325
}
else if ds ,
_ := d .
AsString ();
ds != "[email protected] " {
326
326
t .Fatalf ("invalid email, got %s\n " , ds )
327
327
}
328
328
329
- if d , err := pi .LookupByString ("Date " ); err != nil {
329
+ if d , err := pi .LookupByString ("date " ); err != nil {
330
330
t .Fatalf ("invalid date, got %s\n " , err )
331
331
} else if ds , _ := d .AsString (); ds != "987654" {
332
332
t .Fatalf ("invalid date, got %s\n " , ds )
333
333
}
334
334
335
- if d , err := pi .LookupByString ("Timezone " ); err != nil {
335
+ if d , err := pi .LookupByString ("timezone " ); err != nil {
336
336
t .Fatalf ("invalid tz, got %s\n " , err )
337
337
} else if ds , _ := d .AsString (); ds != "+4321" {
338
338
t .Fatalf ("invalid tz, got %s\n " , ds )
@@ -347,7 +347,7 @@ func TestParsePersonInfo(t *testing.T) {
347
347
t .Fatal ("not equal" , p5 , pi .GitString ())
348
348
}
349
349
350
- if d , err := pi .LookupByString ("Name " ); err != nil {
350
+ if d , err := pi .LookupByString ("name " ); err != nil {
351
351
t .Fatalf ("invalid name, got %s\n " , err )
352
352
} else if ds , _ := d .AsString (); ds != "Someone " {
353
353
t .Fatalf ("invalid name, got %s\n " , ds )
@@ -423,7 +423,7 @@ func BenchmarkRawData(b *testing.B) {
423
423
}
424
424
425
425
func BenchmarkCid (b * testing.B ) {
426
- lb := cidlink.LinkPrototype {cid.Prefix {
426
+ lb := cidlink.LinkPrototype {Prefix : cid.Prefix {
427
427
Version : 1 ,
428
428
Codec : cid .GitRaw ,
429
429
MhType : 0x11 ,
0 commit comments