I've been adding diligently to manual_tests but not actually performing any manual tests before releases. They were just a todo list of automated tests to write, and long out of date. Now the list is up to date and much shorter.
DSLD74DK3P6J2VAFCYF5BGTHZ637QTW3PDHOUHFACDZU66YNM3IAC
KOTI3MFGQ4PDS4I75JIJG734LTET6745VGTSMNFYYASVIO6H2KPAC
YW5324Q3R7HPTO3BIYC55XNAZCPVPNWW6TKSADJSA47F2LOUWVLQC
CPZGQT72EBP3SEDBPDWQRK5IUGA664PHXNP2GOHJLP43PKPWF25AC
LXTTOB33N2HCUZFIUDRQGGBVHK2HODRG4NBLH6RXRQZDCHF27BSAC
BJ5X5O4ACBBJ56LRBBSTCW6IBQP4HAEOOOPNH3SKTA4F66YTOIDAC
EX3GRC2KYJJ5XDNWZNSJMT3G23WFCKZSB6B5HDFL6WG2YHHGDXCQC
5Q6NIG66SI7CS33S2TVIWSLLICWVAINELJJTMNR2UBWVZPGB7DZAC
5L7K4GBDEAFH44LMLNKVFMHLWDNXXBKRPEI347VE5ZLXVFSMD2FAC
Y36LOGR5X6S6AEJJ3EBVDC4I3RRFRCZ6GXPXSEIOMVXY2B7UCCGQC
F63Q4OV73CQC6WTWDCURANYMF2PM4TJCXWF3FZ25X4QY7ZTEZ6QAC
BYG5CEMVXANDTBI2ORNVMEY6K3EBRIHZHS4QBK27VONJC5537COQC
FEEGTRGQR5PETZZQLXVDMILD3Z3CMXP7IDR3DFVXBCGE7GMHB7GQC
MGT5FTJ35MGYCQO3TZVK3RYUIN5YX475R4XG7RO42SYLYF4AIKFAC
SVJZZDC3K6AKAXHGRNAZKRE2ZXEKJANNLG7LSSUZJARFBL5F7C4AC
C42QQZSFFGU6DZ73MCPGYZJQ675YTMEOJAPQLHKRJLWQH5GMWHMQC
K464QQR4FTXFUMHFWAGOD5DJ6YHUBUKRHLXF2ORE74DVT7TVQ35QC
function test_initial_state()
io.write('\ntest_initial_state')
App.screen.init{width=120, height=60}
Lines = load_array{}
App.draw()
check_eq(#Lines, 1, 'F - test_initial_state/#lines')
check_eq(Cursor1.line, 1, 'F - test_initial_state/cursor:line')
check_eq(Cursor1.pos, 1, 'F - test_initial_state/cursor:pos')
check_eq(Screen_top1.line, 1, 'F - test_initial_state/screen_top:line')
check_eq(Screen_top1.pos, 1, 'F - test_initial_state/screen_top:pos')
end
function test_click_to_create_drawing()
io.write('\ntest_click_to_create_drawing')
App.screen.init{width=120, height=60}
Lines = load_array{}
App.draw()
App.run_after_mouse_click(8,Margin_top+8, 1)
-- cursor skips drawing to always remain on text
check_eq(#Lines, 2, 'F - test_click_to_create_drawing/#lines')
check_eq(Cursor1.line, 2, 'F - test_click_to_create_drawing/cursor')
end
function test_backspace_to_delete_drawing()
io.write('\ntest_backspace_to_delete_drawing')
-- display a drawing followed by a line of text (you shouldn't ever have a drawing right at the end)
App.screen.init{width=120, height=60}
Lines = load_array{'```lines', '```', ''}
-- cursor is on text as always (outside tests this will get initialized correctly)
Cursor1.line = 2
-- backspacing deletes the drawing
App.run_after_keychord('backspace')
check_eq(#Lines, 1, 'F - test_backspace_to_delete_drawing/#lines')
check_eq(Cursor1.line, 1, 'F - test_backspace_to_delete_drawing/cursor')
end
end
function test_insert_newline_at_start_of_line()
io.write('\ntest_insert_newline_at_start_of_line')
-- display a line
App.screen.init{width=25+30, height=60}
Lines = load_array{'abc'}
Line_width = App.screen.width
Cursor1 = {line=1, pos=1}
Screen_top1 = {line=1, pos=1}
Screen_bottom1 = {}
-- hitting the enter key splits the line
App.run_after_keychord('return')
check_eq(Cursor1.line, 2, 'F - test_insert_newline_at_start_of_line/cursor:line')
check_eq(Cursor1.pos, 1, 'F - test_insert_newline_at_start_of_line/cursor:pos')
check_eq(Lines[1].data, '', 'F - test_insert_newline_at_start_of_line/data:1')
check_eq(Lines[2].data, 'abc', 'F - test_insert_newline_at_start_of_line/data:2')
end
function test_backspace_past_line_boundary()
io.write('\ntest_backspace_past_line_boundary')
-- position cursor at start of a (non-first) line
App.screen.init{width=25+30, height=60}
Lines = load_array{'abc', 'def'}
Line_width = App.screen.width
Cursor1 = {line=2, pos=1}
-- backspace joins with previous line
App.run_after_keychord('backspace')
check_eq(Lines[1].data, 'abcdef', "F - test_backspace_past_line_boundary")
file load:
cursor_line = 1
first line is a drawing -> cursor_line = 2
click on text -> cursor moves
click on first character of text -> cursor on first character of text
click to right of text -> cursor past end of line
click to right of wrapped text -> cursor on final character of line
click on drawing -> cursor doesn't move
cursor past end of line -> renders
create drawing -> cursor bumps down below drawing
backspace
cursor_pos == 0, previous line is a drawing -> delete drawing, cursor still visible at start of line
cursor_pos == 0, previous line is text -> join lines, cursor still at same character
enter
cursor_pos == 0 -> insert empty line above current line
scrolling:
given moby dick, a file containing all text:
page up moves top line on screen to bottom
page down moves bottom line on screen to top
cursor remains on screen
cursor remains on text line
'up' arrow with cursor at top of screen scrolls up one line (drawings still fully in or out)
if cursor line wrapped before, it scrolls up by only one screen line
if previous line (above top of screen) wrapped, it scrolls up by only one screen line
'down' arrow with cursor at bottom of screen scrolls down one line (drawings still fully in or out)
if cursor line wrapped before, it scrolls down by only one screen line