Commit 50e89be
committed
Merge the line terminator tests back together
test_write_lineterminator_in_field was a strict superset of
test_write_lineterminator -- same rows, same assertion plus one line,
and the original five terminators were all in its list -- so the older
test asserted nothing the newer one did not. Apply the reviewer's
suggestion in place, as it was written, and keep only the cases the
merged test cannot reach in a second test: every character of a
multi-character terminator rather than just the last, non-members
bracketing each terminator in code point order, and the empty
terminator, which cannot join the first loop because lineterminator[-1]
raises IndexError on ''.
Verified by mutating Modules/_csv.c: the two tests catch an off-by-one
on the cached maximum (c <= -> c <), a maximum that is never populated,
and a dropped membership scan. They also still pass against _csv.c as
it stood before the optimization.1 parent aeb530f commit 50e89be
1 file changed
Lines changed: 3 additions & 22 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
260 | 260 | | |
261 | 261 | | |
262 | 262 | | |
263 | | - | |
264 | | - | |
265 | | - | |
266 | | - | |
267 | | - | |
268 | | - | |
269 | | - | |
270 | | - | |
271 | | - | |
272 | | - | |
273 | | - | |
274 | | - | |
275 | | - | |
276 | 263 | | |
277 | 264 | | |
278 | 265 | | |
| |||
289 | 276 | | |
290 | 277 | | |
291 | 278 | | |
292 | | - | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
293 | 282 | | |
294 | 283 | | |
295 | 284 | | |
296 | 285 | | |
297 | 286 | | |
298 | 287 | | |
299 | 288 | | |
300 | | - | |
301 | | - | |
302 | | - | |
303 | | - | |
304 | | - | |
305 | | - | |
306 | | - | |
307 | | - | |
308 | 289 | | |
309 | 290 | | |
310 | 291 | | |
| |||
0 commit comments