Add lua tests for config file parsing

Bare-bones for now, more tests needed.
This commit is contained in:
Pasi Kallinen
2021-02-10 19:15:35 +02:00
parent 9576154690
commit cc25f40d69
5 changed files with 107 additions and 0 deletions

View File

@@ -171,12 +171,23 @@ Example:
=== parse_config
Parse string as if it was read from a config file.
Always call parse_config_errors afterwards to check for any parsing errors.
Example:
nh.parse_config("OPTIONS=color");
=== parse_config_errors
Returns any errors found when parsing a config file string with parse_config.
Example:
local errors = nh.parse_config("OPTIONS=color\nOPTIONS=!color");
nh.pline("Line: " .. errors[1].line .. ", " .. errors[1].error);
=== pline
Show the text in the message area.