commure / datatest

Datatest -- data-driven test framework for Rust
Apache License 2.0
53 stars 15 forks source link

Improve error recovery on incorrect `bench` annotated function #3

Open estebank opened 5 years ago

estebank commented 5 years ago

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