We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 66c98db commit 10b9afaCopy full SHA for 10b9afa
src/test/mod.rs
@@ -288,6 +288,18 @@ fn stdin_formatting_smoke_test() {
288
assert_eq!(buf, "fn main() {}\r\n".as_bytes());
289
}
290
291
+#[test]
292
+fn stdin_parser_panic_caught() {
293
+ // https://github.com/rust-lang/rustfmt/issues/3239
294
+ for text in ["{", "}"].iter().cloned().map(String::from) {
295
+ let mut buf = vec![];
296
+ let mut session = Session::new(Default::default(), Some(&mut buf));
297
+ let _ = session.format(Input::Text(text));
298
+
299
+ assert!(session.has_parsing_errors());
300
+ }
301
+}
302
303
#[test]
304
fn stdin_disable_all_formatting_test() {
305
match option_env!("CFG_RELEASE_CHANNEL") {
0 commit comments