Commit 65dec2b
committed
Update decimal SQL query assertions to accept both numeric and string representations
Modified the decimal type tests to be more flexible when validating raw SQL
query results from Ecto.Adapters.SQL.query:
- 'decimal fields load and dump as strings': Now uses case pattern matching
to accept either float/integer or binary string representations
- 'handles negative decimals and zero': Normalizes all rows to strings for
comparison, accepting both numeric and string formats
This accommodates different SQLite drivers that may return decimals as
either floats or strings. The loader tests (using TestRepo.get with
Decimal.equal?) remain unchanged and continue to verify proper Ecto
loader behavior.1 parent 8b1d2de commit 65dec2b
1 file changed
Lines changed: 36 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
370 | 370 | | |
371 | 371 | | |
372 | 372 | | |
373 | | - | |
374 | | - | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
375 | 384 | | |
376 | 385 | | |
377 | 386 | | |
| |||
399 | 408 | | |
400 | 409 | | |
401 | 410 | | |
402 | | - | |
403 | | - | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
404 | 436 | | |
405 | 437 | | |
406 | 438 | | |
| |||
0 commit comments