Repository navigation
Commit 4e55cda
committed
test(suites): convert sort/sort-by, keeping printed-form assertions for NaN
Smell-audited: 1: the NaN cases are the finding. Converting a printed-form
comparison to value equality is usually a strengthening; for NaN it is a
silent break, and the runner caught it.
phase14_sort.sh 22 spawns -> suites/sort_test.clj
My first draft asserted `(= [1 ##NaN] (into [] (sort [1 ##NaN])))` and failed:
actual: (not (= [1 ##NaN] [1 ##NaN]))
NaN is not `=` to itself, so that assertion is false whatever sort does — it
could never discriminate. The bash compared printed TEXT, which does. Those
three cases now assert `pr-str` and say why inline, so the next person does
not "improve" them back into value equality.
The rest convert normally: natural-order sorts, explicit comparators,
sort-by projection, the stability case (an all-equal key must preserve input
order), the seq return shape, and the 5000-element scale guard.
Only this file involved NaN among the 19 converted so far; the others assert
over numbers, strings, keywords, chars and quoted forms, where value equality
is both correct and stronger. Every suite passes, which is the evidence.
22 more spawns leave the gate; 673 for the arc across 19 scripts. Suite tier
24 suites / 201 tests / 1138 assertions / 0 failures. e2e 394 scripts (from
410). Gates: e2e_reach, runner_reach 68 units, e2e_dup, accepted_divergences
60 pinned. Smoke green 12/0 in 38s.1 parent 8319be6 commit 4e55cda
3 files changed
Lines changed: 54 additions & 58 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
This file was deleted.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
817 | 817 | | |
818 | 818 | | |
819 | 819 | | |
820 | | - | |
821 | 820 | | |
822 | 821 | | |
823 | 822 | | |
| |||
0 commit comments