Add couple more config tests

This commit is contained in:
Pasi Kallinen
2021-02-13 11:51:25 +02:00
parent 80b82c687b
commit 1b7faaf661

View File

@@ -11,6 +11,9 @@ local configtests = {
{ test = "OPTIONS=!color\nOPTIONS=color",
result = { { line = 2, error = "boolean option specified multiple times: color" } }
},
{ test = "OPTIONS=!color,color",
result = { { line = 1, error = "boolean option specified multiple times: color" } }
},
{ test = "OPTIONS=runmode:crawl",
result = { },
extra = function() return nh.get_config("runmode") == "crawl" end
@@ -25,6 +28,12 @@ local configtests = {
result = { },
extra = function() return nh.get_config("runmode") == "teleport" end
},
{ test = "OPTIONS=runmode:crawl\nOPTIONS=runmode:teleport",
result = { { line = 2, error = "compound option specified multiple times: runmode" } }
},
{ test = "OPTIONS=runmode:run,runmode:walk",
result = { { line = 1, error = "compound option specified multiple times: runmode" } }
},
};