Skip to content

Improve error recovery on incorrect bench annotated function #3

@estebank

Description

@estebank

Forgetting to add a first bencher: &mut test::Bencher, argument to a bench annotated function, causes the following:

error: expected type, found `)`
  --> src/tests/mod.rs:27:47
   |
27 | #[datatest::data("src/tests/index_tests.yaml")]
   |                                               ^

error[E0425]: cannot find value `arg` in this scope
  --> src/tests/mod.rs:27:1
   |
27 | #[datatest::data("src/tests/index_tests.yaml")]
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ not found in this scope

error[E0061]: this function takes 1 parameter but 2 parameters were supplied
  --> src/tests/mod.rs:27:47
   |
27 | #[datatest::data("src/tests/index_tests.yaml")]
   |                                               ^ expected 1 parameter
28 | #[bench]
29 | fn test_index(case: &TestCase) {
   | ------------------------------ defined here

CC #2

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions