turborepo
a812571f - Reduce macro usage in turbo-tasks-testing (#8832)

Commit
1 year ago
Reduce macro usage in turbo-tasks-testing (#8832) ## What? Replaces the `turbo_tasks_testing::run!` macro with a `run` function that requires an opaque registration argument generated by the `register!` macro. ## Why? A few reasons: - `cargo fmt` doesn't work inside macros (with the exception of function-like macros), so our tests weren't getting autoformatted. - When a test fails, it was hard to know what line it failed on, because the failure is attributed to the first line of the macro usage. ## Related Changes - This also changes many (though not all) `.await?`s into `.await.unwrap()`s. The reason for this is similar: it's easier to attribute the line that causes a panic than the line that returns an error. I left some tests alone as there were more `?`s than I felt like changing. - `register!()` now takes an optional list of other register functions to call. The tests in `turbo-tasks-fetch` use this. ## Testing Instructions ``` cargo nextest run ```
Author
bgw bgw
Parents
Loading