Commit 40e6756
committed
gh-156955: Cover line terminator quoting in the csv writer tests
Apply the reviewer's suggestion on GH-156956: exercise csv.writer with a
field that embeds the line terminator, over terminators spanning the
latin-1, BMP and non-BMP string kinds.
Add two more tests for the paths the optimization introduced but nothing
pinned:
* test_write_lineterminator_quoting -- every character of a
multi-character terminator forces quoting, not just the last, and
characters bracketing the terminator in code point order do not.
* test_write_empty_lineterminator -- an empty terminator has no
characters, so it separates nothing and quotes nothing, including
'\0'.
All three pass against Modules/_csv.c as it stood before the
optimization, so they pin existing csv.writer semantics rather than new
behavior.1 parent 3b2ec50 commit 40e6756
1 file changed
Lines changed: 29 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
260 | 260 | | |
261 | 261 | | |
262 | 262 | | |
263 | | - | |
| 263 | + | |
| 264 | + | |
264 | 265 | | |
265 | 266 | | |
266 | 267 | | |
267 | 268 | | |
268 | 269 | | |
269 | 270 | | |
| 271 | + | |
270 | 272 | | |
271 | 273 | | |
272 | 274 | | |
273 | | - | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
274 | 301 | | |
275 | 302 | | |
276 | 303 | | |
| |||
0 commit comments