CLI: test that plain escapes controls only

This commit is contained in:
bflatastic committed 2026-11-07 08:56:32 +07:00
1 parent 680ec56c89
commit 8802f3fd49
1 file changed
+6
+6
View File
@@ -505,6 +505,12 @@ pub fn connect_publish(file: &str, mappings: &str, dry_run: bool) -> CliResult<E
mod tests {
use super::*;
#[test]
fn plain_escapes_controls_and_leaves_quotes_and_paths() {
assert_eq!(plain("a\u{1b}[31m\nb"), r"a\u{1b}[31m\nb");
assert_eq!(plain(r"Bob's C:\files"), r"Bob's C:\files");
}
#[test]
fn script_formats() {
assert_eq!(parse_script(r#"[{"command":"a"},{"command":"b","params":{"x":1}}]"#).unwrap().len(), 2);