Skip to content

Commit 98975e1

Browse files
tests: adjust some cherry-picekd tests
1 parent 2b6226c commit 98975e1

File tree

2 files changed

+7
-16
lines changed

2 files changed

+7
-16
lines changed

src/test/mod.rs

-16
Original file line numberDiff line numberDiff line change
@@ -483,22 +483,6 @@ fn format_lines_errors_are_reported_with_tabs() {
483483
assert!(session.has_formatting_errors());
484484
}
485485

486-
#[test]
487-
fn parser_creation_errors_on_entry_new_parser_from_file_panic() {
488-
// See also https://github.com/rust-lang/rustfmt/issues/4418
489-
let filename = "tests/parser/issue_4418.rs";
490-
let file = PathBuf::from(filename);
491-
let (config, operation, _) = read_config(&file);
492-
if let Err(OperationError::ParseError { input, is_panic }) =
493-
format_file(&file, operation, config)
494-
{
495-
assert_eq!(input.as_path().unwrap(), file);
496-
assert!(is_panic);
497-
} else {
498-
panic!("Expected ParseError operation error");
499-
}
500-
}
501-
502486
// For each file, run rustfmt and collect the output.
503487
// Returns the number of files checked and the number of failures.
504488
fn check_files(files: Vec<PathBuf>, opt_config: &Option<PathBuf>) -> (Vec<FormatReport>, u32, u32) {

src/test/parser.rs

+7
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,13 @@ fn assert_parser_error(filename: &str) {
4242
assert!(session.has_parsing_errors());
4343
}
4444

45+
#[test]
46+
fn parser_creation_errors_on_entry_new_parser_from_file_panic() {
47+
// See also https://github.com/rust-lang/rustfmt/issues/4418
48+
let filename = "tests/parser/issue_4418.rs";
49+
assert_parser_error(filename);
50+
}
51+
4552
#[test]
4653
fn crate_parsing_errors_on_unclosed_delims() {
4754
// See also https://github.com/rust-lang/rustfmt/issues/4466

0 commit comments

Comments
 (0)