Testing framework that provides "data provider"?

I currently organize my tests with first a collection/vec which represents the "inputs":

fn get_data_provider() -> Vec<Input> {
  let inputs : Vec<Input> = Vec::new();
  // push

Then I iterate over these inputs and for each I assert the result of some calculation:

fn my_test() {
  for input in get_data_provider() {
    let result = doSomething(input);
    assert_eq!(true, result);

It's is considered as "one test" only by cargo:

cargo test
running 1 test

I am looking for more granularity, where each item of the "data provider" / collection, is considered a single test, more precisely I am trying to reproduce what I learned a long time ago in PHP with phpunit testing framework which offers "data provider".

If you are aware of anything close to that?


This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.