From 2a42c645d0bd2993fce0e57df40f89c5e884fd88 Mon Sep 17 00:00:00 2001 From: Ed Page Date: Wed, 8 Mar 2023 12:00:01 -0600 Subject: [PATCH] test(edit): Add reproduction for 527 --- crates/toml_edit/tests/testsuite/parse.rs | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/crates/toml_edit/tests/testsuite/parse.rs b/crates/toml_edit/tests/testsuite/parse.rs index ed3ca303..69cbc116 100644 --- a/crates/toml_edit/tests/testsuite/parse.rs +++ b/crates/toml_edit/tests/testsuite/parse.rs @@ -231,6 +231,23 @@ fn empty_table() { table["foo"].as_table().unwrap(); } +#[test] +fn mixed_table_issue_527() { + let input = r#" +[package] +metadata.msrv = "1.65.0" + +[package.metadata.release.pre-release-replacements] +"#; + let expected = r#" +[package] +metadata.msrv = "1.65.0" +"#; + let document = input.parse::().unwrap(); + let actual = document.to_string(); + assert_eq(expected, actual); +} + #[test] fn fruit() { let table = r#"