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 8222381 commit 69c9765Copy full SHA for 69c9765
src/test/mod.rs
@@ -288,6 +288,19 @@ 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 res = ::std::panic::catch_unwind(|| {
296
+ let mut buf = vec![];
297
+ let mut session = Session::new(Default::default(), Some(&mut buf));
298
+ session.format(Input::Text(text))
299
+ });
300
+ assert!(res.is_ok());
301
+ }
302
+}
303
+
304
#[test]
305
fn stdin_disable_all_formatting_test() {
306
match option_env!("CFG_RELEASE_CHANNEL") {
0 commit comments