mirror of
https://github.com/rust-lang/rust.git
synced 2025-02-15 00:13:02 +00:00
tests: adjust some cherry-picekd tests
This commit is contained in:
parent
2b6226ce49
commit
98975e1a64
@ -483,22 +483,6 @@ fn format_lines_errors_are_reported_with_tabs() {
|
||||
assert!(session.has_formatting_errors());
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn parser_creation_errors_on_entry_new_parser_from_file_panic() {
|
||||
// See also https://github.com/rust-lang/rustfmt/issues/4418
|
||||
let filename = "tests/parser/issue_4418.rs";
|
||||
let file = PathBuf::from(filename);
|
||||
let (config, operation, _) = read_config(&file);
|
||||
if let Err(OperationError::ParseError { input, is_panic }) =
|
||||
format_file(&file, operation, config)
|
||||
{
|
||||
assert_eq!(input.as_path().unwrap(), file);
|
||||
assert!(is_panic);
|
||||
} else {
|
||||
panic!("Expected ParseError operation error");
|
||||
}
|
||||
}
|
||||
|
||||
// For each file, run rustfmt and collect the output.
|
||||
// Returns the number of files checked and the number of failures.
|
||||
fn check_files(files: Vec<PathBuf>, opt_config: &Option<PathBuf>) -> (Vec<FormatReport>, u32, u32) {
|
||||
|
@ -42,6 +42,13 @@ fn assert_parser_error(filename: &str) {
|
||||
assert!(session.has_parsing_errors());
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn parser_creation_errors_on_entry_new_parser_from_file_panic() {
|
||||
// See also https://github.com/rust-lang/rustfmt/issues/4418
|
||||
let filename = "tests/parser/issue_4418.rs";
|
||||
assert_parser_error(filename);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn crate_parsing_errors_on_unclosed_delims() {
|
||||
// See also https://github.com/rust-lang/rustfmt/issues/4466
|
||||
|
Loading…
Reference in New Issue
Block a user