# To ensure forwards compatibility with more arguments being added in the future,
# adding an attribute which can't be deconstructed :)
"lib.fileset.fileFilter: The predicate function passed as the first argument must be able to handle extra attributes for future compatibility. If you're using `{ name, file }:`, use `{ name, file, ... }:` instead."=null;
}
then
subtree
type
else
null;
# Check the predicate for all files in a directory
expectFailure 'fileFilter null (abort "this is not needed")''lib.fileset.fileFilter: First argument is of type null, but it should be a function instead.'
# The second argument can be a file set or an existing path
expectFailure 'fileFilter (file: abort "this is not needed") null''lib.fileset.fileFilter: Second argument is of type null, but it should be a file set or a path instead.'
expectFailure 'fileFilter (file: abort "this is not needed") ./a''lib.fileset.fileFilter: Second argument \('"$work"'/a\) is a path that does not exist.'
# The predicate is not called when there's no files
tree=()
checkFileset 'fileFilter (file: abort "this is not needed") ./.'