Fix the indentation in test_lua_wml

This main change here is moving tags to their own line, to avoid wmlindent
bug #1397. The lua gets a manual tabs-to-spaces conversion.
This commit is contained in:
Steve Cotton 2021-04-15 11:09:44 +02:00 committed by Steve Cotton
parent dd864d5a4a
commit adf39d3d4a

View file

@ -1,14 +1,16 @@
# wmllint: no translatables
{GENERIC_UNIT_TEST "test_wml_actions" ( {GENERIC_UNIT_TEST "test_wml_actions" (
[event] [event]
name = start name = start
[lua] [lua]
code = << code = <<
function wesnoth.wml_actions.foo(cfg) function wesnoth.wml_actions.foo(cfg)
if cfg.bar then if cfg.bar then
wml.variables["result"] = cfg.bar wml.variables["result"] = cfg.bar
end end
end end
>> >>
[/lua] [/lua]
{VARIABLE result 0} {VARIABLE result 0}
@ -39,39 +41,47 @@
name = start name = start
[lua] [lua]
code = << code = <<
function wesnoth.wml_conditionals.foo(cfg) function wesnoth.wml_conditionals.foo(cfg)
return (cfg.bar == "baz") return (cfg.bar == "baz")
end end
>> >>
[/lua] [/lua]
{ASSERT ([foo] {ASSERT (
bar = "baz" [foo]
[/foo])} bar = "baz"
{ASSERT ([not] [/foo]
[foo] )}
bar = "boo" {ASSERT (
[/foo] [not]
[/not])} [foo]
{ASSERT ([foo] bar = "boo"
bar = "baz" [/foo]
[/foo] [/not]
[or] )}
[foo] {ASSERT (
bar = "boo" [foo]
[/foo] bar = "baz"
[/or])} [/foo]
{ASSERT ([not] [or]
[foo] [foo]
bar = "baz" bar = "boo"
[/foo] [/foo]
[and] [/or]
[foo] )}
bar = "boo" {ASSERT (
[/foo] [not]
[/and] [foo]
[/not])} bar = "baz"
[/foo]
[and]
[foo]
bar = "boo"
[/foo]
[/and]
[/not]
)}
{SUCCEED} {SUCCEED}
[/event] [/event]
)} )}