Add class indent tests
This commit is contained in:
parent
f6c2b4c65e
commit
3b2796d9ad
14
test/indent/classes.tig
Normal file
14
test/indent/classes.tig
Normal file
|
@ -0,0 +1,14 @@
|
|||
class A {
|
||||
var a := 12
|
||||
|
||||
method method() : int = 1
|
||||
}
|
||||
|
||||
type B = class extends A {
|
||||
var b := 27
|
||||
|
||||
method another_method() = (
|
||||
print("called");
|
||||
self.b + self.method()
|
||||
)
|
||||
}
|
|
@ -30,6 +30,16 @@ describe("indent Tiger:", function()
|
|||
end)
|
||||
|
||||
describe("new line:", function()
|
||||
runner:new_line("classes.tig", { on_line = 1, text = "var a := 0", indent = 2 }, "class declaration beginning", XFAIL)
|
||||
runner:new_line("classes.tig", { on_line = 2, text = "var a := 0", indent = 2 }, "class declaration after field")
|
||||
runner:new_line("classes.tig", { on_line = 4, text = "var a := 0", indent = 2 }, "class declaration after method")
|
||||
runner:new_line("classes.tig", { on_line = 5, text = "var a := 0", indent = 0 }, "after class declaration")
|
||||
runner:new_line("classes.tig", { on_line = 7, text = "var a := 0", indent = 2 }, "class type beginning", XFAIL)
|
||||
runner:new_line("classes.tig", { on_line = 8, text = "var a := 0", indent = 2 }, "class type after field")
|
||||
runner:new_line("classes.tig", { on_line = 10, text = "self.a := 0", indent = 4 }, "inside method", XFAIL)
|
||||
runner:new_line("classes.tig", { on_line = 13, text = "var a := 0", indent = 2 }, "class type after method")
|
||||
runner:new_line("classes.tig", { on_line = 14, text = "var a := 0", indent = 0 }, "after class type")
|
||||
|
||||
runner:new_line("groupings.tig", { on_line = 2, text = "var b := 0", indent = 2 }, "let declarations")
|
||||
runner:new_line("groupings.tig", { on_line = 3, text = "a := a + 1", indent = 2 }, "after 'in'", XFAIL)
|
||||
runner:new_line("groupings.tig", { on_line = 4, text = "a := a + 1;", indent = 4 }, "sequence", XFAIL)
|
||||
|
|
Loading…
Reference in a new issue