Commit 914560c
authored
Add finer-grain reference tests for translation phase (#103)
### Motivation
We have a reference test, which we've been making use of to validate
end-to-end generation from OpenAPI document matches handwritten Swift
files. This started out life as the canonical Petstore example from the
OpenAPI specification but has since been augmented in various ways to
test out some edge cases. This approach isn't scaling too well as we
have an all-or-nothing test.
We also don't have great test coverage over the translation phase of the
generator pipeline, which translates between the parsed OpenAPI document
to an intermediate representation.
### Modifications
Add test harnesses for finer grain reference tests that exercise smaller
sections of the translation phase. It should allow us to test a small
OpenAPI document renders to _equivalent_ Swift source (stripping
comments and reformatting).
### Result
Hopefully a more modular and maintainable testing strategy as we try to
support more of the OpenAPI specification.
### Test Plan
This PR _is_ tests.
---------
Signed-off-by: Si Beaumont <beaumont@apple.com>1 parent 8c5258b commit 914560c
File tree
3 files changed
+813
-31
lines changed- Tests/OpenAPIGeneratorReferenceTests
3 files changed
+813
-31
lines changedLines changed: 5 additions & 31 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
36 | | - | |
| 36 | + | |
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
| |||
82 | 82 | | |
83 | 83 | | |
84 | 84 | | |
85 | | - | |
86 | 85 | | |
87 | | - | |
88 | | - | |
| 86 | + | |
89 | 87 | | |
90 | 88 | | |
91 | 89 | | |
| |||
143 | 141 | | |
144 | 142 | | |
145 | 143 | | |
146 | | - | |
147 | | - | |
148 | | - | |
149 | | - | |
150 | | - | |
151 | | - | |
152 | | - | |
153 | | - | |
154 | | - | |
155 | | - | |
156 | | - | |
157 | | - | |
158 | | - | |
159 | | - | |
160 | | - | |
161 | | - | |
162 | | - | |
163 | | - | |
164 | | - | |
165 | | - | |
166 | | - | |
167 | | - | |
168 | | - | |
169 | | - | |
170 | | - | |
171 | | - | |
| 144 | + | |
| 145 | + | |
172 | 146 | | |
173 | 147 | | |
174 | 148 | | |
| |||
183 | 157 | | |
184 | 158 | | |
185 | 159 | | |
186 | | - | |
| 160 | + | |
187 | 161 | | |
188 | 162 | | |
189 | 163 | | |
| |||
0 commit comments