[go: up one dir, main page]

rstest 0.8.0

Rust fixture based test framework. It use procedural macro to implement fixtures and table based tests.
Documentation
use proc_macro2::TokenStream;
use quote::{quote, ToTokens};
use syn::Ident;

pub(crate) trait WrapByModule {
    fn wrap_by_mod(&self, mod_name: &Ident) -> TokenStream;
}

impl<T: ToTokens> WrapByModule for T {
    fn wrap_by_mod(&self, mod_name: &Ident) -> TokenStream {
        quote! {
            mod #mod_name {
                use super::*;

                #self
            }
        }
    }
}