Function run_tests

Source
pub fn run_tests(category: &str, runner: fn(&str) -> String)
Expand description

Pulls tests from category, running them through the runner and comparing them against expectations in previous runs.

The tests are .leo files in tests/{category}, and the runner receives the contents of each of them as a &str, returning a String result. A test is considered to have failed if it panics or if results differ from the previous run.

If no corresponding .out file is found in expecations/{category}, or if the environment variable REWRITE_EXPECTATIONS is set, no comparison to a previous result is done and the result of the current run is written to the file.