Skip to content

Commit

Permalink
Merge pull request #825 from catalyst/issue824
Browse files Browse the repository at this point in the history
Close issue #824 - fix: properly handle limit in directory_file_list_trait
  • Loading branch information
keevan authored Aug 11, 2023
2 parents a553594 + 41afec2 commit 3ad7f30
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
1 change: 1 addition & 0 deletions classes/local/step/directory_file_list_trait.php
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,7 @@ function ($filename) use ($basepath) {

$func($filelist);

$limit = empty($limit) ? null : $limit;
// Apply the offset and limit.
$filelist = array_slice($filelist, $offset, $limit);

Expand Down
10 changes: 10 additions & 0 deletions tests/tool_dataflows_sftp_test.php
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,16 @@ public function sftp_list_constraints_provider(): array {
'test.csv',
],
],
[
['relativepath', 'alpha', 0, 0, false, '', '*.csv'],
[
'2019-08-03-123451001.csv',
'2019-08-03-123451002.csv',
'2019-08-03-123451003.csv',
'output/2019-08-03-123451002-final.csv',
'test.csv',
],
],
[
['relativepath', 'alpha_reverse', 0, 1, false, '', '*.csv'],
['test.csv'],
Expand Down

0 comments on commit 3ad7f30

Please sign in to comment.