mirror of
https://github.com/zed-industries/zed.git
synced 2024-11-07 20:39:04 +03:00
Don't let people retry randomized tests
Co-Authored-By: Antonio Scandurra <me@as-cii.com>
This commit is contained in:
parent
6efadd19dd
commit
84fc8f0f4f
@ -52,6 +52,12 @@ pub fn test(args: TokenStream, function: TokenStream) -> TokenStream {
|
||||
}
|
||||
|
||||
let mut inner_fn = parse_macro_input!(function as ItemFn);
|
||||
if max_retries > 0 && num_iterations > 1 {
|
||||
return TokenStream::from(
|
||||
syn::Error::new_spanned(inner_fn, "retries and randomized iterations can't be mixed")
|
||||
.into_compile_error(),
|
||||
);
|
||||
}
|
||||
let inner_fn_attributes = mem::take(&mut inner_fn.attrs);
|
||||
let inner_fn_name = format_ident!("_{}", inner_fn.sig.ident);
|
||||
let outer_fn_name = mem::replace(&mut inner_fn.sig.ident, inner_fn_name.clone());
|
||||
|
Loading…
Reference in New Issue
Block a user