From 9f73862d51d284b62d33ca6fb95c7d936fb62d30 Mon Sep 17 00:00:00 2001 From: Thomas Waldmann Date: Wed, 28 May 2025 22:33:27 +0200 Subject: [PATCH] sparse test: test for transformation of all-zero blocks into CH_ALLOC chunks --- src/borg/testsuite/chunker_pytest_test.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/borg/testsuite/chunker_pytest_test.py b/src/borg/testsuite/chunker_pytest_test.py index 2c5829cdf..0b61c1b57 100644 --- a/src/borg/testsuite/chunker_pytest_test.py +++ b/src/borg/testsuite/chunker_pytest_test.py @@ -427,11 +427,13 @@ def test_filefmapreader_with_real_sparse_file(tmpdir): {"data_type": bytes, "allocation": CH_DATA, "size": BS}, ] - # Expected chunks when reading with sparse=False + # Expected chunks when reading with sparse=False. + # Even though it is not differentiating data vs hole ranges, it still + # transforms detected all-zero blocks to CH_ALLOC chunks. expected_chunks_non_sparse = [ {"data_type": bytes, "allocation": CH_DATA, "size": BS}, - {"data_type": bytes, "allocation": CH_DATA, "size": BS}, - {"data_type": bytes, "allocation": CH_DATA, "size": BS}, + {"data_type": type(None), "allocation": CH_ALLOC, "size": BS}, + {"data_type": type(None), "allocation": CH_ALLOC, "size": BS}, {"data_type": bytes, "allocation": CH_DATA, "size": BS}, ]