mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +00:00
Settings: Fail on invalid sequence and throw exception for LuaSettings
This commit is contained in:
parent
b0c4fd6d3f
commit
d3dc88fe6b
4 changed files with 89 additions and 53 deletions
|
@ -531,9 +531,12 @@ struct TestSettings: public TestBase
|
|||
group2->setS16("num_oranges", 53);
|
||||
group2->setGroup("animals", group3);
|
||||
group2->set("animals", "cute"); //destroys group 3
|
||||
s.setGroup("groupy_thing", group2);
|
||||
|
||||
// the bad chars in here should be stripped
|
||||
s.setGroup("groupy \"_\" thing", group2);
|
||||
// Test set failure conditions
|
||||
UASSERT(s.set("Zoop = Poop\nsome_other_setting", "false") == false);
|
||||
UASSERT(s.set("sneaky", "\"\"\"\njabberwocky = false") == false);
|
||||
UASSERT(s.set("hehe", "asdfasdf\n\"\"\"\nsomething = false") == false);
|
||||
|
||||
// Test multiline settings
|
||||
UASSERT(group->get("ccc") == "testy\n testa ");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue