On Thu, May 25, 2023 at 11:51:18PM +0900, torikoshia wrote:
> Updated patches according to your comment.

-   ok(!-f "$tempdir/$walfiles[1]",
-       "$test_name: second older WAL file was cleaned up");
-   ok(-f "$tempdir/$walfiles[2]",
+   ok(!-f "$tempdir/@$walfiles[1]",
+       "$test_name: second older WAL/backup history file was cleaned up");
+   ok(-f "$tempdir/@$walfiles[2]",

This is still a bit confusing, because as designed the test has a
dependency on the number of elements present in the list, and the
description of the test may not refer to what's actually used (the
second element of each list is either a WAL segment or a backup
history file).  I think that I would just rewrite that so as we have a
list of WAL segments in an array with the expected result associated
to each one of them.  Basically, something like that:
my @wal_segments = (
  { name => "SEGMENT1", present => 0 },
  { name => "BACKUPFILE1", present => 1 },
  { name => "SEGMENT2", present => 0 });

Then the last part of run_check() would loop through all the elements
listed.
--
Michael

Attachment: signature.asc
Description: PGP signature

Reply via email to