Add values/expressions indent tests

This commit is contained in:
Bruno BELANYI 2022-06-13 11:18:36 +02:00
parent 59db3f195b
commit 964c9a685d
2 changed files with 37 additions and 0 deletions

View file

@ -0,0 +1,24 @@
let
type array_of_int = array of int
var a :=
"a string"
in
array[
12
]
;
array_of_int[
27
]
of
42
;
record {
a = 1,
b = "2",
c = nil
}
end

View file

@ -65,5 +65,18 @@ describe("indent Tiger:", function()
runner:new_line("groupings.tig", { on_line = 4, text = "a := a + 1;", indent = 4 }, "sequence", XFAIL) runner:new_line("groupings.tig", { on_line = 4, text = "a := a + 1;", indent = 4 }, "sequence", XFAIL)
runner:new_line("groupings.tig", { on_line = 8, text = "a := a + 1;", indent = 2 }, "after sequence") runner:new_line("groupings.tig", { on_line = 8, text = "a := a + 1;", indent = 2 }, "after sequence")
runner:new_line("groupings.tig", { on_line = 10, text = "+ 1", indent = 0 }, "after 'end'") runner:new_line("groupings.tig", { on_line = 10, text = "+ 1", indent = 0 }, "after 'end'")
runner:new_line("values-and-expressions.tig", { on_line = 4, text = "0", indent = 4 }, "variable declaration init value", XFAIL)
runner:new_line("values-and-expressions.tig", { on_line = 5, text = "+ a", indent = 4 }, "variable declaration init follow-up")
runner:new_line("values-and-expressions.tig", { on_line = 7, text = "a", indent = 4 }, "array index", XFAIL)
runner:new_line("values-and-expressions.tig", { on_line = 8, text = "+ a", indent = 4 }, "array index follow-up")
runner:new_line("values-and-expressions.tig", { on_line = 9, text = "+ a", indent = 2 }, "after array value")
runner:new_line("values-and-expressions.tig", { on_line = 12, text = "a", indent = 4 }, "array expression size", XFAIL)
runner:new_line("values-and-expressions.tig", { on_line = 14, text = "of", indent = 2 }, "array expression after size")
runner:new_line("values-and-expressions.tig", { on_line = 15, text = "a", indent = 4 }, "array expression init value", XFAIL)
runner:new_line("values-and-expressions.tig", { on_line = 19, text = "field = 0,", indent = 4 }, "record expression beginning", XFAIL)
runner:new_line("values-and-expressions.tig", { on_line = 20, text = "field = 0,", indent = 4 }, "record expression middle")
runner:new_line("values-and-expressions.tig", { on_line = 22, text = ",field = 0", indent = 4 }, "record expression end")
runner:new_line("values-and-expressions.tig", { on_line = 23, text = "a := 0", indent = 2 }, "after record expression")
end) end)
end) end)