//! These tests are just a way to quickly run the `#[implement]` macro and see its output. //! They don't check the output in any way. //! //! This exists because of some difficulties of running `cargo expand` against the `#[implement]` //! macro. It's also just really convenient. You can see the output by using `--nocapture` and //! you'll probably want to restrict the output to a single thread: //! //! ```text //! cargo test -p windows-implement --lib -- --nocapture --test-threads=1 //! ```
use std::io::{Read, Write}; use std::process::{Command, Stdio};
use proc_macro2::TokenStream; use quote::quote;
fn implement(attributes: TokenStream, item_tokens: TokenStream) -> String { let out_tokens = crate::implement_core(attributes, item_tokens); let tokens_string = out_tokens.to_string();
let out_string = rustfmt(&tokens_string);
println!("// output of #[implement] :");
println!();
println!("{}", out_string);
out_string
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.