@@ -16,24 +16,32 @@ import (
16
16
17
17
func TestPhysicalBlobFile_ParseRoundTrip (t * testing.T ) {
18
18
testCases := []struct {
19
- name string
20
- input string
21
- output string
19
+ name string
20
+ input string
21
+ output string
22
+ creationTime uint64
22
23
}{
23
24
{
24
25
name : "verbatim" ,
25
26
input : "000001 size:[903530 (882KB)] vals:[39531 (39KB)]" ,
26
27
},
27
28
{
28
- name : "whitespace is insignificant" ,
29
- input : "000001 size : [ 903530 (882KB )] vals: [ 39531 ( 39KB ) ]" ,
30
- output : "000001 size:[903530 (882KB)] vals:[39531 (39KB)]" ,
29
+ name : "whitespace is insignificant" ,
30
+ input : "000001 size : [ 903530 (882KB )] vals: [ 39531 ( 39KB ) ] creationTime: 1718851200" ,
31
+ output : "000001 size:[903530 (882KB)] vals:[39531 (39KB)]" ,
32
+ creationTime : 1718851200 ,
31
33
},
32
34
{
33
35
name : "humanized sizes are optional" ,
34
36
input : "000001 size:[903530] vals:[39531]" ,
35
37
output : "000001 size:[903530 (882KB)] vals:[39531 (39KB)]" ,
36
38
},
39
+ {
40
+ name : "creation time is optional" ,
41
+ input : "000001 size:[903530 (882KB)] vals:[39531 (39KB)] creationTime:1718851200" ,
42
+ output : "000001 size:[903530 (882KB)] vals:[39531 (39KB)]" ,
43
+ creationTime : 1718851200 ,
44
+ },
37
45
}
38
46
for _ , tc := range testCases {
39
47
t .Run (tc .name , func (t * testing.T ) {
@@ -45,6 +53,7 @@ func TestPhysicalBlobFile_ParseRoundTrip(t *testing.T) {
45
53
want = tc .output
46
54
}
47
55
require .Equal (t , want , got )
56
+ require .Equal (t , tc .creationTime , m .CreationTime )
48
57
})
49
58
}
50
59
}
@@ -61,14 +70,19 @@ func TestBlobFileMetadata_ParseRoundTrip(t *testing.T) {
61
70
},
62
71
{
63
72
name : "whitespace is insignificant" ,
64
- input : "B000002 physical : {000001 size : [ 903530 (882KB )] vals: [ 39531 ( 39KB ) ] }" ,
73
+ input : "B000002 physical : {000001 size : [ 903530 (882KB )] vals: [ 39531 ( 39KB ) ] creationTime: 1718851200 }" ,
65
74
output : "B000002 physical:{000001 size:[903530 (882KB)] vals:[39531 (39KB)]}" ,
66
75
},
67
76
{
68
77
name : "humanized sizes are optional" ,
69
78
input : "B000002 physical:{000001 size:[903530] vals:[39531]}" ,
70
79
output : "B000002 physical:{000001 size:[903530 (882KB)] vals:[39531 (39KB)]}" ,
71
80
},
81
+ {
82
+ name : "creation time is optional" ,
83
+ input : "B000002 physical:{000001 size:[903530 (882KB)] vals:[39531 (39KB)] creationTime:1718851200}" ,
84
+ output : "B000002 physical:{000001 size:[903530 (882KB)] vals:[39531 (39KB)]}" ,
85
+ },
72
86
}
73
87
for _ , tc := range testCases {
74
88
t .Run (tc .name , func (t * testing.T ) {
0 commit comments