Commit 6834e48
committed
test: make "expect an empty body" expressible (it silently wasn't)
Execute() gated the body comparison on `test.Expected != ""`, so an empty
Expected meant "don't check the body" — which is also exactly how a ported test
has to spell PostgREST's `shouldRespondWith ""`. The two are indistinguishable,
so every ported test expecting an empty body silently degraded to a status-only
check: 116 of ~800 across insert (17), update (16), range (24), rpc (14), query
(13), embed_inner_join (15), delete (7) and others.
That is a hole in a suite whose entire purpose is catching PostgREST deviations:
it cannot see the one class of response PostgREST defines by absence — and
writes default to `Prefer: return=minimal`, so that class is every write.
Adds an explicit ExpectedEmpty bool. Additive: Go's zero value keeps every
existing test's behaviour unchanged.
Marks the three insert cases whose PostgREST comment reads `shouldRespondWith ""`
with matchStatus 201. They fail against the current POST handler — see the next
commit. The remaining 113 are left for triage: "Expected is empty" does not by
itself mean "PostgREST expects empty" (many are GETs where the porter simply
didn't fill in the body), so they need reading against their Haskell comment
rather than a bulk flip.1 parent ec7d0a9 commit 6834e48
2 files changed
Lines changed: 30 additions & 15 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | | - | |
36 | | - | |
37 | | - | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
38 | 47 | | |
39 | 48 | | |
40 | 49 | | |
| |||
134 | 143 | | |
135 | 144 | | |
136 | 145 | | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
137 | 152 | | |
138 | 153 | | |
139 | 154 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
34 | | - | |
35 | | - | |
36 | | - | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
| |||
80 | 80 | | |
81 | 81 | | |
82 | 82 | | |
83 | | - | |
84 | | - | |
85 | | - | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
86 | 86 | | |
87 | 87 | | |
88 | 88 | | |
| |||
105 | 105 | | |
106 | 106 | | |
107 | 107 | | |
108 | | - | |
109 | | - | |
110 | | - | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
111 | 111 | | |
112 | 112 | | |
113 | 113 | | |
| |||
0 commit comments