We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
このようなテンプレートにRustのユニットテストを生成するようにすればVSCodeとかのGUIデバッガで動かせて便利なのではという考え。やるとすればproc-macroも良いが完全にstdのみで動く簡潔なテストがベストか。
std
use proconio::source::once::OnceSource; use std::io::Write; fn main() { let mut input = ::std::string::String::new(); ::std::io::Read::read_to_string(&mut std::io::stdin(), &mut input).unwrap(); let stdout = ::std::io::stdout(); let mut output = ::std::io::BufWriter::new(stdout.lock()); crate::solve(&input, &mut output); ::std::io::Write::flush(&mut output).unwrap(); } fn solve<S: AsRef<str>, W: Write>(input: S, mut output: W) { let input = input.as_ref(); let mut input = OnceSource::from(input); macro_rules! input(($($tt:tt)*) => (proconio::input!(from &mut input, $($tt)*))); macro_rules! println(($($tt:tt)*) => (writeln!(output, $($tt)*).unwrap())); input! { n: usize, } println!("{}", 2 * n); }
The text was updated successfully, but these errors were encountered:
あるいはintegration-testで
#[allow(dead_code) #[path = "../src/bin/a.rs"] mod a;
ってやるか。せっかくRustに密なんだしいつかやりたい。
Sorry, something went wrong.
No branches or pull requests
このようなテンプレートにRustのユニットテストを生成するようにすればVSCodeとかのGUIデバッガで動かせて便利なのではという考え。やるとすればproc-macroも良いが完全に
std
のみで動く簡潔なテストがベストか。The text was updated successfully, but these errors were encountered: