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PNH3SKTA4F66YTOIDAC function App.version_check()-- available modes: run, errorError_message = nilError_count = 0-- we'll reuse error mode on load for an initial version checklocal supported_versions = {'11.5', '11.4', '12.0'} -- put the recommended version firstlocal minor_versionMajor_version, minor_version = love.getVersion()Version = Major_version..'.'..minor_versionif array.find(supported_versions, Version) == nil thenCurrent_app = 'error'Error_message = ("This app doesn't support version %s; please use version %s. Press any key to try it with this version anyway."):format(Version, supported_versions[1])print(Error_message)-- continue initializing everything; hopefully we won't have errors during initializationendend
function App.initialize_globals()Supported_versions = {'11.5', '11.4', '12.0'} -- put the recommended version firstcheck_love_version_for_tests()
function App.love_version_check()if Unsupported_version thenCurrent_app = 'error'Error_message = ("This app hasn't been tested with LÖVE version %s; please switch to version %s if you run into issues. Press any key to continue."):format(Version, Supported_versions[1])print(Error_message)-- continue initializing everything; hopefully we won't have errors during initializationendend
error(('There were %d test failures:\n\n%s'):format(#Test_errors, table.concat(Test_errors)))
local error_message = ''if Warning_before_tests thenerror_message = Warning_before_tests..'\n\n'enderror_message = error_message .. ('There were %d test failures:\n%s'):format(#Test_errors, table.concat(Test_errors))error(error_message)
- run with an unsupported version. Error message pops up and waits for a key. The app attempts to continue, and doesn't receive the key.
- run with an untested version. Error message pops up and waits for a key. The app attempts to continue, and doesn't receive the key.
* run with an unsupported version. Error message pops up and waits for a key. The app attempts to continue, and doesn't receive the key. Press ctrl+e to edit source. Source editor opens up without checking version.
* run with an untested version. Error message pops up. Press a key. Text editor comes up, and doesn't receive the key. Press ctrl+e. Source editor opens up. Press ctrl+e. Text editor returns.* create a couple of spuriously failing tests. Run with an untested version. Error message includes message about untested version.