| 7 | LuaStyle TestHelper::DefaultStyle; |
| 8 | |
| 9 | bool TestHelper::TestFormatted(std::string input, const std::string &shouldBe, LuaStyle &style) { |
| 10 | auto file = std::make_shared<LuaSource>(std::move(input)); |
| 11 | LuaLexer luaLexer(file); |
| 12 | luaLexer.Parse(); |
| 13 | |
| 14 | LuaParser p(file, std::move(luaLexer.GetTokens())); |
| 15 | p.Parse(); |
| 16 | |
| 17 | LuaSyntaxTree t; |
| 18 | t.BuildTree(p); |
| 19 | |
| 20 | FormatBuilder f(style); |
| 21 | auto text = f.GetFormatResult(t); |
| 22 | |
| 23 | return string_util::TrimSpace(text) == string_util::TrimSpace(shouldBe); |
| 24 | } |
| 25 | |
| 26 | bool TestHelper::TestRangeFormatted(std::size_t startLine, std::size_t endLine, std::string input, |
| 27 | const std::string &shouldBe, LuaStyle &style) { |
nothing calls this directly
no test coverage detected