Skip to content

Commit

Permalink
* sort arrays to prevent fs ordering differences
Browse files Browse the repository at this point in the history
  • Loading branch information
ollydev committed Feb 22, 2024
1 parent 92ffa0b commit d78acb9
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Tests/zip.simba
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ begin

ZipFiles(SimbaEnv.TempPath + 'test.zip', [SimbaEnv.TempPath + 'file1.txt', SimbaEnv.TempPath + 'file2.txt', SimbaEnv.TempPath + 'file3.txt']);

Entries := ZipReadEntries(ZipFile);
Entries := Sorted(ZipReadEntries(ZipFile));
Assert(Length(Entries) = 3);
Assert(Entries[0] = 'file1.txt');
Assert(Entries[1] = 'file2.txt');
Expand All @@ -34,7 +34,7 @@ begin

ZipExtract(ZipFile, OutputDir);

Files := DirList(OutputDir);
Files := Sorted(DirList(OutputDir));
Assert(Length(Files) = 3);
Assert(PathExtractName(Files[0]) = 'file1.txt');
Assert(PathExtractName(Files[1]) = 'file2.txt');
Expand All @@ -49,7 +49,7 @@ begin

ZipExtractEntry(ZipFile, 'file1.txt', OutputDir);

Files := DirList(OutputDir);
Files := Sorted(DirList(OutputDir));
Assert(Length(Files) = 1);
Assert(PathExtractName(Files[0]) = 'file1.txt');
end;
Expand All @@ -61,7 +61,7 @@ begin
Clean();

Assert(ZipExtractEntries(ZipFile, OutputDir, ['file2.txt', 'file3.txt', 'nope']) = 2);
Files := DirList(OutputDir);
Files := Sorted(DirList(OutputDir));
Assert(Length(Files) = 2);
Assert(PathExtractName(Files[0]) = 'file2.txt');
Assert(PathExtractName(Files[1]) = 'file3.txt');
Expand Down

0 comments on commit d78acb9

Please sign in to comment.