-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
removed trailing newlines from formatting/CLI output, fixed issue #1
- Loading branch information
1 parent
de61f3e
commit c8816d8
Showing
12 changed files
with
589 additions
and
354 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#[cfg(feature = "regen-tests")] | ||
fn main() { | ||
use std::fs::{read_dir, File}; | ||
use std::io::{BufWriter, Write}; | ||
|
||
let mut test_suite = BufWriter::new(File::create("tests/main.rs").unwrap()); | ||
writeln!(test_suite, "mod common;\nuse common::cmp;\n").unwrap(); | ||
|
||
for entry in read_dir("tests/samples").unwrap() { | ||
let entry = entry.unwrap(); | ||
let mut src = entry.path(); | ||
let name = src.file_name().unwrap().to_str().unwrap().to_owned(); | ||
src.push("source.rs"); | ||
let dst = src.with_file_name("target.rs"); | ||
|
||
writeln!( | ||
test_suite, | ||
"#[test] fn {name}() {{\n\tcmp({src:?}, {dst:?})\n}}\n" | ||
) | ||
.unwrap(); | ||
} | ||
} | ||
|
||
#[cfg(not(feature = "regen-tests"))] | ||
fn main() {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.