Function brane_shr::utilities::test_on_dsl_files_in_async
source · pub async fn test_on_dsl_files_in_async<F, R>(
mode: &'static str,
path: impl AsRef<Path>,
exec: F,
)
Expand description
Runs a given closure on all files in the given folder.
This function runs the searching and loading of files asynchronously, for server contexts.
§Generic arguments
F
: The function signature of the closure. It simply accepts the path and source text of a single file, and returns a future that represents the test code. If it should cause the test to fail, that future should panic.
§Arguments
mode
: The mode to run in. May either be ‘BraneScript’ or ‘Bakery’.path
: The path to search for files in.exec
: The closure that runs code on every file in the appropriate language’s text.
§Panics
This function panics if the test failed (i.e., if the files could not be found or the closure panics).