This also makes our testing questions less thorny. If and when Pong gets tests, they'll load and run independently of the source editor.
One remaining issue: making changes to the source editor's tests won't actually run immediately on ctrl+e. Instead, it'll only run when you ctrl+e a second time to bring back the editor.
3LWDKR5FPZNW2ESSTTLWBBEBJ3B77UH4NEOC26PHOVG4HKOU4VQAC
4FL2EDGBMB7ORKXCHLSZTSMNDZELNV65M4OYHMFMU6FCSQFM3BMQC
4TOADL2SFUZYNP3ZO3AIBN66QAWZDL5XIZZEA3DLYRF6SSEGLF3AC
5GCISXOWAGUWQL72WLGRAL65UE6XM6HXIVPKGNGXX3DWF5CRDRDQC
UH4YWHW5NDKNR7RS664UG4PRJNZIPNWAD5JWBEUB22JHOY2SWZKAC
OTIBCAUJ3KDQJLVDN3A536DLZGNRYMGJLORZVR3WLCGXGO6UGO6AC
ONWEPEFITJ2ZMN4SY4NE7CVBXSR7XEHDSMIG7IV64653EXAQYDSQC
2L5MEZV344TOZLVY3432RHJFIRVXFD6O3GWLL5O4CV66BGAFTURQC
PH7S4VLYKRQY62VQ4NR2VIBAUVLVYQLEZYMGHUK6GND3KDBLSZTAC
GRSHSSV5ZRYOXD3SGMCOXKVFXLNZYLAN3YVBDUE6IVZBIK5S3UXQC
AD34IX2ZSGYGU3LGY2IZOZNKD4HRQOYJVG5UWMWLXJZJSM62FFOAC
UOTHQWM74AFOCPGQKKPLZXRI5HQFH3SRGI336AVZRGWPR6P256EAC
5YGO6JX5WTBNIRW2LKLJF7EE7Z5UNXAMLG24AUV5BK227S4AI4IQC
564RK5FW46AHODXU7LMSGA5LQND5SIFQTZMBFEKYEA3KGMED4JBAC
WQXU5WRHJKWTC3YYFAC7OZVQSWKW2QGPQK4VWOSXEQUGDU2T3TQAC
3QNOKBFMKBGXBVJIRHR2444JRRMBTABHE4674NR3DT67RRM2X6GAC
-- file editing
load_file_from_source_or_save_directory('source.lua')
load_file_from_source_or_save_directory('commands.lua')
load_file_from_source_or_save_directory('edit.lua')
load_file_from_source_or_save_directory('log_browser.lua')
load_file_from_source_or_save_directory('text.lua')
load_file_from_source_or_save_directory('search.lua')
load_file_from_source_or_save_directory('select.lua')
load_file_from_source_or_save_directory('undo.lua')
load_file_from_source_or_save_directory('colorize.lua')
load_file_from_source_or_save_directory('text_tests.lua')
if Current_app == nil then
Current_app = 'pong'
end
if Current_app == 'pong' then
load_file_from_source_or_save_directory('pong.lua')
else
load_file_from_source_or_save_directory('source.lua')
load_file_from_source_or_save_directory('commands.lua')
load_file_from_source_or_save_directory('edit.lua')
load_file_from_source_or_save_directory('log_browser.lua')
load_file_from_source_or_save_directory('text.lua')
load_file_from_source_or_save_directory('search.lua')
load_file_from_source_or_save_directory('select.lua')
load_file_from_source_or_save_directory('undo.lua')
load_file_from_source_or_save_directory('colorize.lua')
load_file_from_source_or_save_directory('text_tests.lua')
end
end
pong.initialize_globals()
source.initialize_globals()
-- HACK: always open in editor in tests; we don't yet have any tests for pong
-- (I have no idea how we'll run them when we get them.)
Current_app = 'source'
if Current_app == 'pong' then
pong.initialize_globals()
elseif Current_app == 'source' then
source.initialize_globals()
else
assert(false, 'unknown app "'..Current_app..'"')
end
-- now tests are done; open 'pong' by default
Current_app = 'pong'
if love.filesystem.getInfo('config') then
Settings = json.decode(love.filesystem.read('config'))
Current_app = Settings.current_app
end