Skip to content

Commit 42f7a1b

Browse files
committed
test(encode): Show existing quote behavior
1 parent dbf1cc1 commit 42f7a1b

File tree

1 file changed

+30
-0
lines changed
  • crates/toml_edit/tests/testsuite

1 file changed

+30
-0
lines changed

crates/toml_edit/tests/testsuite/edit.rs

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,36 @@ key3 = 8.1415926
200200
"#]]);
201201
}
202202

203+
#[test]
204+
fn test_insert_key_with_quotes() {
205+
given(
206+
r#"
207+
[package]
208+
name = "foo"
209+
210+
[target]
211+
"#,
212+
)
213+
.running(|root| {
214+
root["target"]["cfg(target_os = \"linux\")"] = table();
215+
root["target"]["cfg(target_os = \"linux\")"]["dependencies"] = table();
216+
root["target"]["cfg(target_os = \"linux\")"]["dependencies"]["name"] = value("dep");
217+
})
218+
.produces_display(str![[r#"
219+
220+
[package]
221+
name = "foo"
222+
223+
[target]
224+
225+
[target."cfg(target_os = \"linux\")"]
226+
227+
[target."cfg(target_os = \"linux\")".dependencies]
228+
name = "dep"
229+
230+
"#]]);
231+
}
232+
203233
// removal
204234

205235
#[test]

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy