Skip to content

Commit

Permalink
Fix test cases for previous commit
Browse files Browse the repository at this point in the history
  • Loading branch information
FPtje committed Dec 29, 2023
1 parent 136d2c8 commit 2cec52d
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 9 deletions.
2 changes: 2 additions & 0 deletions tests/golden/data/input/various-comments.lua
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ end
local function foo() -- same-line-comment
end

-- Rendering of comments after return (or instead of return) reported here:
-- https://github.com/FPtje/GLuaFixer/issues/170#issuecomment-1828253356
function foo()
-- Comment before return
return 1, 2, 3 -- comment on same line as return
Expand Down
4 changes: 3 additions & 1 deletion tests/golden/data/output/issue-106.lua
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
a(
{b},
function() end, -- comment
function()
-- comment
end,
function() end
)
23 changes: 15 additions & 8 deletions tests/golden/data/output/various-comments.lua
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
-- Comment before if-statement
if false then end -- same-line comment
-- print("TODO")
if false then -- same-line comment
-- print("TODO")
end

if true then
a = 2 -- bar
end
Expand All @@ -26,28 +28,33 @@ if true then
end

-- Comment before if-statement
if true then return end
-- comment after return on new line
if true then
return
-- comment after return on new line
end

-- Comment before if-statement
if true then return end
-- comment after end
if true or false then return end --[[ comment in condition]] -- single line comment in condition
for var = 1, 10 do -- same-line comment
-- print("TODO")
end

-- print("TODO")
for k, v in pairs(player.GetAll()) do -- same-line comment
-- print("TODO")
end

-- print("TODO")
function foo() -- same-line-comment
end

local function foo() -- same-line-comment
end

-- Rendering of comments after return (or instead of return) reported here:
-- https://github.com/FPtje/GLuaFixer/issues/170#issuecomment-1828253356
function foo()
-- Comment before return
return 1, 2, 3 -- comment on same line as return
end
-- comment after return
-- comment after return
end

0 comments on commit 2cec52d

Please sign in to comment.