Keep mid-field quotes when splitting with Text to Columns (#2438)

Found while testing crates/engine/src/cmd/data.rs:992 (split_delimited, used by text_to_columns)

Co-authored-by: Claude Haiku 5.5 <noreply@anthropic.com>
This commit is contained in:
NetterSilverandClaude Haiku 5.5 authored and GitHub committed 2026-11-14 16:54:24 +01:00
1 parent fdba683246
commit 45ee4eceed
3 files changed
+18 -3

No files matched your search

+2 -2
View File
@@ -175,8 +175,8 @@ fn text_to_columns_keeps_a_py_piece_as_text() {
s.execute("cell.set", json!({"cell": "A1", "input": "'=PY(\"x\");7"})).unwrap();
assert_eq!(super::v(&s, "A1"), Value::text("=PY(\"x\");7"));
s.execute("data.textToColumns", json!({"range": "A1", "delimiters": [";"]})).unwrap();
// The default text qualifier takes the quotes away, as in Excel.
assert_eq!(super::v(&s, "A1"), Value::text("=PY(x)"), "the piece is kept, not cleared");
// A quote in the middle of a field is kept, as in Excel.
assert_eq!(super::v(&s, "A1"), Value::text("=PY(\"x\")"), "the piece is kept, not cleared");
assert_eq!(code(&s, 0, "A1"), None, "and it is not a Python cell");
assert_eq!(super::v(&s, "B1"), Value::Number(7.0));
}