Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a basic test for Lua language #1212

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 48 additions & 0 deletions tests/data/lua.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
-- 48 lines 12 code 26 comments 10 blanks

-- Standard comment

-- Standard block comment
--[[
print("Hello world")
--]]

-- The following print statement isn't a commented
---[[
print("Hello world")
--]]

-- Another block comment
--[=[
We can include "]]" inside this comment
--]=]

--[==[
We can include "]=]" inside this comment
--]==]


local s = [[--[[ and -- don't start comments inside multiline strings.
A multiline string.
It can't contain double square brackets. Instead one must write: [=[]=].
]]

local s = [=[
Also a multiline string.
This one can contain [[]].
Alternatively, one may add one more equal sign between the square brackets: [==[]==]
]=]

-- Here only the first print statement is executed
---[[
print("Hello world 1")
--[=[]]
print("Hello world 2")
--]=]

-- Here only the second print statement is executed
--[[
print("Hello world 1")
--[=[]]
print("Hello world 2")
--]=]