Skip to content

Commit

Permalink
test(encode): Show existing quote behavior
Browse files Browse the repository at this point in the history
  • Loading branch information
epage committed Jun 3, 2024
1 parent dbf1cc1 commit 42f7a1b
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions crates/toml_edit/tests/testsuite/edit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,36 @@ key3 = 8.1415926
"#]]);
}

#[test]
fn test_insert_key_with_quotes() {
given(
r#"
[package]
name = "foo"
[target]
"#,
)
.running(|root| {
root["target"]["cfg(target_os = \"linux\")"] = table();
root["target"]["cfg(target_os = \"linux\")"]["dependencies"] = table();
root["target"]["cfg(target_os = \"linux\")"]["dependencies"]["name"] = value("dep");
})
.produces_display(str![[r#"
[package]
name = "foo"
[target]
[target."cfg(target_os = \"linux\")"]
[target."cfg(target_os = \"linux\")".dependencies]
name = "dep"
"#]]);
}

// removal

#[test]
Expand Down

0 comments on commit 42f7a1b

Please sign in to comment.