note "\nTest function: get_files_in_watched_directory"; subtest 'get_files_in_watched_directory' => sub { my @got_files; my @expected_files; my $project_name = 'default'; # create a temporary directory my $temp_dir = tempdir( CLEANUP => 1 ); # create some temporary files in the directory my ($temp_file1_handle, $temp_file1) = tempfile(DIR => $temp_dir); my ($temp_file2_handle, $temp_file2) = tempfile(DIR => $temp_dir); my ($temp_file3_handle, $temp_file3) = tempfile(DIR => $temp_dir); my ($temp_file4_handle, $temp_file4) = tempfile(DIR => $temp_dir); my ($temp_file5_handle, $temp_file5) = tempfile(DIR => $temp_dir); # create an array populated with the names of the temporary files that we expectd to see push (@expected_files, basename($temp_file1)); push (@expected_files, basename($temp_file2)); push (@expected_files, basename($temp_file3)); push (@expected_files, basename($temp_file4)); push (@expected_files, basename($temp_file5)); # now pass the temporary directory to the the function # the function should return an array @got_files with the names of the files in the directory @got_files = get_files_in_watched_directory($temp_dir, $project_name, \@expected_files); print "\n\nGOT\n"; print Dumper(@got_files); print "\n"; print "\n\nEXPECTED\n"; print Dumper(@expected_files); print "\n"; #compare the two arrays is_deeply(\@got_files, \@expected_files, 'Function should return a list of directory contents that will be processed'); };