mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2026-06-13 23:36:45 +03:00
test(s3): deref Object.Size in versioned list assertion (#9843)
TestVersionedObjectListBehavior compared int64 against listedObject.Size, which is *int64, so the assertion always failed on a type mismatch once reached. Dereference it (and in the log line).
This commit is contained in:
@@ -664,7 +664,7 @@ func TestVersionedObjectListBehavior(t *testing.T) {
|
||||
assert.NotContains(t, *listedObject.Key, versionId, "Object key should not contain version ID")
|
||||
|
||||
// Verify object properties
|
||||
assert.Equal(t, int64(len(content)), listedObject.Size, "Object size should match")
|
||||
assert.Equal(t, int64(len(content)), *listedObject.Size, "Object size should match")
|
||||
assert.NotNil(t, listedObject.ETag, "Object should have ETag")
|
||||
assert.NotNil(t, listedObject.LastModified, "Object should have LastModified")
|
||||
|
||||
@@ -674,7 +674,7 @@ func TestVersionedObjectListBehavior(t *testing.T) {
|
||||
assert.NotEmpty(t, listedObject.Owner.DisplayName, "Owner DisplayName should not be empty")
|
||||
|
||||
t.Logf("Listed object: Key=%s, Size=%d, Owner.ID=%s, Owner.DisplayName=%s",
|
||||
*listedObject.Key, listedObject.Size, *listedObject.Owner.ID, *listedObject.Owner.DisplayName)
|
||||
*listedObject.Key, *listedObject.Size, *listedObject.Owner.ID, *listedObject.Owner.DisplayName)
|
||||
|
||||
// Test list-objects-v2 operation as well
|
||||
listV2Resp, err := client.ListObjectsV2(context.TODO(), &s3.ListObjectsV2Input{
|
||||
|
||||
Reference in New Issue
Block a user