Revanth14 commented on code in PR #1286:
URL: https://github.com/apache/iceberg-go/pull/1286#discussion_r3470209709


##########
table/orphan_cleanup_test.go:
##########
@@ -621,6 +622,16 @@ func TestDeleteFilesFallsBackToExistingBehavior(t 
*testing.T) {
        assert.ElementsMatch(t, orphans, deleted)
 }
 
+func TestWalkDirectoryRequiresListableIO(t *testing.T) {
+       err := walkDirectory(&mockPlainIO{}, "s3://bucket/data", func(string, 
stdfs.FileInfo) error {
+               require.Fail(t, "walk callback should not run for non-listable 
IO")
+
+               return nil
+       })
+       require.Error(t, err)
+       assert.Contains(t, err.Error(), "does not implement io.ListableIO")

Review Comment:
   Added `TestWalkDirectoryUsesListableIO`, which drives a seeded `ListableIO` 
mock through `walkDirectory` and asserts the callback receives exactly the 
expected files: directories filtered out, paths and sizes intact. It fails if 
the body is reduced to the error return.
   
   I went with a small mock rather than `MemFS` to keep the test focused on the 
`ListableIO` contract, but happy to switch to `MemFS` if you’d prefer.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to