diff --git a/tests/system.rs b/tests/system.rs index 1cdd43abbfa..d0769a855ac 100644 --- a/tests/system.rs +++ b/tests/system.rs @@ -26,8 +26,11 @@ fn get_path_string(dir_entry: io::Result) -> String { path.to_str().expect("Couldn't stringify path.").to_owned() } -// For now, the only supported regression tests are idempotent tests - the input and +// Integration tests and idempotence tests. The files in the tests/source are +// formatted and compared to their equivalent in tests/target. The target file +// and config can be overriden by annotations in the source file. The input and // output must match exactly. +// Files in tests/target are checked to be unaltered by rustfmt. // FIXME(#28) would be good to check for error messages and fail on them, or at least report. #[test] fn system_tests() { diff --git a/tests/idem/enum.rs b/tests/target/enum.rs similarity index 100% rename from tests/idem/enum.rs rename to tests/target/enum.rs diff --git a/tests/target/issue-64.rs b/tests/target/issue-64.rs new file mode 100644 index 00000000000..c0660630203 --- /dev/null +++ b/tests/target/issue-64.rs @@ -0,0 +1,7 @@ +// Regression test for issue 64 + +pub fn header_name() -> &'static str { + let name = ::header_name(); + let func = ::header_name; + name +} diff --git a/tests/idem/tuple.rs b/tests/target/tuple.rs similarity index 100% rename from tests/idem/tuple.rs rename to tests/target/tuple.rs