diff options
| author | Caleb Cartwright <caleb.cartwright@outlook.com> | 2020-10-29 22:59:45 -0500 |
|---|---|---|
| committer | Caleb Cartwright <calebcartwright@users.noreply.github.com> | 2020-11-02 18:31:51 -0600 |
| commit | 98975e1a64dbb8e00907a61cf642c02e76aa75a3 (patch) | |
| tree | 88ac0a8c97f95c5911e6e8a37f35ccf24ea42244 /src/test | |
| parent | 2b6226ce497ce9b3b9a0a3fe22a707fefcd8c2ee (diff) | |
tests: adjust some cherry-picekd tests
Diffstat (limited to 'src/test')
| -rw-r--r-- | src/test/mod.rs | 16 | ||||
| -rw-r--r-- | src/test/parser.rs | 7 |
2 files changed, 7 insertions, 16 deletions
diff --git a/src/test/mod.rs b/src/test/mod.rs index 7d2e8c18e9c..9b3ca717152 100644 --- a/src/test/mod.rs +++ b/src/test/mod.rs @@ -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) { diff --git a/src/test/parser.rs b/src/test/parser.rs index 75aed32e68b..ae4a4f94d92 100644 --- a/src/test/parser.rs +++ b/src/test/parser.rs @@ -43,6 +43,13 @@ fn assert_parser_error(filename: &str) { } #[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 let filename = "tests/parser/unclosed-delims/issue_4466.rs"; |
