ci/test.lua: fix string splitting

string:split() isn't part of the standard library, but is defined if
`gui/load-screen.lua` is run. This happens in the default dfhack.init-example
and on GitHub Actions, but not on Buildmaster.

This is an intermediate solution to get CI working again. A more complete
solution would be to move string:split() to dfhack.lua, like
string:startswith(), or to take a pass over scripts and make sure they aren't
modifying built-in types like string/table.
develop
lethosor 2021-05-28 00:17:20 -04:00
parent 300bfe7daf
commit c0cdf5bcac
No known key found for this signature in database
GPG Key ID: 76A269552F4F58C1
1 changed files with 2 additions and 2 deletions

@ -539,12 +539,12 @@ local function main(args)
{'d', 'test_dir', hasArg=true, {'d', 'test_dir', hasArg=true,
handler=function(arg) test_dir = arg end}, handler=function(arg) test_dir = arg end},
{'m', 'modes', hasArg=true, {'m', 'modes', hasArg=true,
handler=function(arg) mode_filter = arg:split(',') end}, handler=function(arg) mode_filter = utils.split_string(arg, ',') end},
{'r', 'resume', handler=function() resume = true end}, {'r', 'resume', handler=function() resume = true end},
{'s', 'save_dir', hasArg=true, {'s', 'save_dir', hasArg=true,
handler=function(arg) save_dir = arg end}, handler=function(arg) save_dir = arg end},
{'t', 'tests', hasArg=true, {'t', 'tests', hasArg=true,
handler=function(arg) test_filter = arg:split(',') end}, handler=function(arg) test_filter = utils.split_string(arg, ',') end},
}) })
if help then print(help_text) return end if help then print(help_text) return end