about summary refs log tree commit diff stats
path: root/log.lua
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2024-01-12 03:03:31 -0800
committerKartik K. Agaram <vc@akkartik.com>2024-01-12 03:22:43 -0800
commit57fb2d4b57db3fef5245d40e16f5ea811c3806a4 (patch)
treecf0bb86a8224323f67c798cf9a12806b23bff3cc /log.lua
parentaa6bfb4b15ea75fa289b78cacc7de38f41daf69a (diff)
downloadtext.love-57fb2d4b57db3fef5245d40e16f5ea811c3806a4.tar.gz
clean up test mocks before aborting
Scenario:
  modify a test to fail in the source editor
  delete any settings in the 'config' file in the save dir
  start lines.love
  press C-e to switch to source editor

Before this commit, this scenario led to the following events:
  the C-e keypress invokes App.run_tests_and_initialize()
  the failing test results in a call to error()
  the call to error() is trapped by the xpcall around the event handler in love.run
  handle_error runs
  Current_app is 'source', so love.event.quit() is triggered
  love.quit() is invoked
  source.settings() is invoked
  App.screen.position() is invoked, which calls the test mock
  Since App.screen.move was never invoked, App.screen.position() returns nil
  The 'config' file is written without values for source.x and source.y

As a result, future runs fail to open.

This is likely a corner case only I will ever run into, since I'm
careful to never commit failing unit tests. Still, I spent some time
trying to figure out the best place to fix this. Options:
* don't write config if Error_message is set
  but we do want config written in this scenario:
  * we hit an error, source editor opens
  * we spend some time debugging and don't immediately fix the issue
  * we quit, with some new files opened in various places
* hardcode source.settings() to call love.window.getPosition() rather
  than App.screen.position().
  drawback: weird special case
* clean up test mocks before aborting
  this seems like something we always want

I'm not very sure of my choice.
This bug doesn't leave me feeling very great about my whole app.
Arguably everything I've done is bullshit hacks piled on hacks.

Perhaps the issue is:
  - naked error() in LÖVE apps never invokes love.quit(), but
  - an unhandled error within my handle_error invokes love.quit() (via
    love.event.quit)
Perhaps LÖVE should provide a way to abort without invoking the quit
handler. There's literally no other way in LÖVE to request a quit.
Diffstat (limited to 'log.lua')
0 files changed, 0 insertions, 0 deletions
>
b514fbb9 ^


87f58c6c ^
aecc8475 ^
af571dd8 ^


f5465e12 ^
af571dd8 ^

f5465e12 ^
af571dd8 ^

f5465e12 ^
2f02189d ^
af571dd8 ^


9570363a ^
af571dd8 ^
513ba330 ^
af571dd8 ^
513ba330 ^


56356de8 ^

bf37b4d5 ^
56356de8 ^



76755b28 ^


edfc4cf8 ^
af571dd8 ^

f5465e12 ^



f6b44306 ^
2f02189d ^
f6b44306 ^



af571dd8 ^
f6b44306 ^
f5465e12 ^
f6b44306 ^
f5465e12 ^
6a9d8191 ^

f6b44306 ^

ff229aec ^
f6b44306 ^
2f02189d ^
f6b44306 ^
2f02189d ^
0428419c ^
2f02189d ^
f6b44306 ^
2f02189d ^
f5465e12 ^
f6b44306 ^
f5465e12 ^
f6b44306 ^
76755b28 ^
2f02189d ^
76755b28 ^
f6b44306 ^
76755b28 ^
f6b44306 ^
2f02189d ^




f344b250 ^










2f02189d ^
76755b28 ^



2f02189d ^

76755b28 ^

f6b44306 ^
2f02189d ^


fbbbd625 ^
2f02189d ^





f344b250 ^

2f02189d ^

ff229aec ^
2f02189d ^
c842d90b ^


70471628 ^


32b8fac2 ^
2f02189d ^













f344b250 ^

f6b44306 ^
81a324be ^
2f02189d ^

81a324be ^
c842d90b ^
81a324be ^
ff229aec ^


81a324be ^
ff229aec ^
2f02189d ^




76755b28 ^
f6b44306 ^

f5465e12 ^
f6b44306 ^
d009e158 ^
f6b44306 ^

d009e158 ^
f6b44306 ^

d009e158 ^
f6b44306 ^
aa42c864 ^
2f02189d ^
0428419c ^
f5465e12 ^
9570363a ^

f5465e12 ^
2f02189d ^












0428419c ^
f6b44306 ^
ff229aec ^
2f02189d ^
ff229aec ^
f5465e12 ^
2f02189d ^

ff229aec ^
2f02189d ^
4bf7453a ^








c842d90b ^

f6b44306 ^
2f02189d ^
f6b44306 ^
56356de8 ^

c603cd6c ^
f6b44306 ^
c603cd6c ^
f6b44306 ^
c603cd6c ^

762b099e ^
c603cd6c ^
762b099e ^
c603cd6c ^
56356de8 ^











2f02189d ^
56356de8 ^
2f02189d ^
8e7b4429 ^
f5465e12 ^
f6b44306 ^

2f02189d ^




f5465e12 ^
2f02189d ^


f5465e12 ^








eea17dee ^
f5465e12 ^
2f02189d ^

f5465e12 ^
2f02189d ^




f5465e12 ^

2f02189d ^
f5465e12 ^

2f02189d ^



dcc060c7 ^
2f02189d ^
f5465e12 ^
f6b44306 ^
b514fbb9 ^

e877e1fc ^


fd5e720b ^



e877e1fc ^

b514fbb9 ^


70763af3 ^








6845c4d9 ^
70763af3 ^




b514fbb9 ^
f6b44306 ^
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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
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
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334