I also really need to rethink how people debug my programs. My approach of inserting and deleting print() takes a lot of commitment. I need my old trace-based whitebox testing idea. However, in my past projects I never did figure out a good framework for tweaking how verbose a trace to emit.
Perhaps that's too many knobs. Perhaps we just need a way to run a single test with the most verbose trace possible. Then it's just a matter of having the trace tell a coherent story? But even if the trace stays out of program output in that situation, it's still in the programmer's face in the code. Ugh.
Current plan: ship program with maximum tests and zero commented-out prints. If you want to debug, insert prints. This is better than previous, text-mode, projects just by virtue of the stdout channel being dedicated to debug stuff.
YTSPVDZHEN5LLNMGIBUBLPWFWSFM3SOHBRGWYSDEVFKRTH24ARRQC
3OKKTUT4Q7W44JHILOFV5BVUA7ZOBIHBCEXGZ65CPXV4PRLI2W4QC
IRV65LZPHFLLYPTMLTDO6OJDHVZQJ6MFXZ45IRXRDSRSEQNO5DIAC
QYIFOHW3WDDQMK4ATY6IOSQRFHJOQ5QCPDKRC4GVGWLQEH4HGWVQC
WLHI7KD3LJTQH6V7RLVJWGZUR4YQK6LN4OIUMIN45BGMMQGN6RNQC
ESETRNLB3MIJ2SID6HJMMP52FEVUBLGK2HLWD75KDQZAKQMKSF2QC
BULPIBEGL7TMK6CVIE7IS7WGAHGOSUJBGJSFQK542MOWGHP2ADQQC
CVGE3SIGJRGCLY3A2RBPGFXAEKVZXUUIZQLRHJLM4VPUM4SHEZIAC
PFT5Y2ZYGQA6XXOZ5HH75WVUGA4B3KTDRHSFOZRAUKTPSFOPMNRAC
2RXZ3PGOTTZ6M4R372JXIKPLBQKPVBMAXNPIEO2HZDN4EMYW4GNAC
TRNWIQN6RPLDLYWULLKG5L255E7E3DPNGLCSLAF6IJWYQRCCLARQC
OTIBCAUJ3KDQJLVDN3A536DLZGNRYMGJLORZVR3WLCGXGO6UGO6AC
UWNHC4AAO3SPOYLPANTO4WKCTZL7KAYC73Q2YUZFFW7K26FVJ7FQC
7IKRRESBHMYHHKW4XHUEEKHKPOBLAGZ7A7FJMRU32MTRKIV6S7GQC
DLQMM2656JHXX3ONOEM6UIOXKFJFT5QT7RHWK7YS2W77PVZWHRSAC
4C375P53EXHUPXUFQSI3LA7THEP2WOKX5ZB57OQ5ZSM7LYOVW5HAC
AVTNUQYRBW7IX2YQ3KDLVQ23RGW3BAKTAE7P73ASBYNKOHMQMH5AC
6LJZN727CRPYR34LV75CQF55YZI3E7MGESYZSFSYAE73SNEZE3FAC
XNFTJHC4QSHNSIWNN7K6QZEZ37GTQYKHS4EPNSVPQCUSWREROGIQC
VHQCNMARPMNBSIUFLJG7HVK4QGDNPCGNVFLHS3I4IGNVSV5MRLYQC
3QNOKBFMKBGXBVJIRHR2444JRRMBTABHE4674NR3DT67RRM2X6GAC
function test_pagedown()
print('test_pagedown')
App.screen.init{width=120, height=45}
Lines = load_array{'abc', 'def', 'ghi'}
Line_width = 120
Cursor1 = {line=1, pos=1}
Screen_top1 = {line=1, pos=1}
Screen_bottom1 = {}
Zoom = 1
local screen_top_margin = 15 -- pixels
local line_height = math.floor(15*Zoom) -- pixels
-- initially the first two lines are displayed
App.draw()
local y = screen_top_margin
App.screen.check(y, 'abc', 'F - test_pagedown/baseline/screen:1')
y = y + line_height
App.screen.check(y, 'def', 'F - test_pagedown/baseline/screen:2')
-- after pagedown the bottom line becomes the top
App.run_after_keychord('pagedown')
y = screen_top_margin
App.screen.check(y, 'def', 'F - test_pagedown/screen:1')
y = y + line_height
App.screen.check(y, 'ghi', 'F - test_pagedown/screen:2')
end
function test_pagedown_skip_drawings()
print('test_pagedown_skip_drawings')
-- some lines of text with a drawing intermixed
App.screen.init{width=50, height=45}
Lines = load_array{'abc',
'```lines', '```',
'def',
'ghi'}
check_eq(Lines[2].mode, 'drawing', 'F - test_pagedown_skip_drawings/baseline/lines')
Line_width = App.screen.width
Cursor1 = {line=1, pos=1}
Screen_top1 = {line=1, pos=1}
Screen_bottom1 = {}
Zoom = 1
local screen_top_margin = 15 -- pixels
local drawing_height = App.screen.width / 2 -- default
-- initially the screen displays the first line and part of the drawing
App.draw()
local y = screen_top_margin
App.screen.check(y, 'abc', 'F - test_pagedown_skip_drawings/baseline/screen:1')
-- after pagedown the screen draws the screen up top
App.run_after_keychord('pagedown')
y = screen_top_margin + drawing_height
App.screen.check(y, 'def', 'F - test_pagedown_skip_drawings/screen:1')
y = y + line_height
App.screen.check(y, 'ghi', 'F - test_pagedown_skip_drawings/screen:2')
end