Skip to content
This repository has been archived by the owner on Nov 20, 2020. It is now read-only.

Commit

Permalink
tests for do
Browse files Browse the repository at this point in the history
  • Loading branch information
leafo committed Nov 1, 2012
1 parent c783eff commit 0d1f25c
Show file tree
Hide file tree
Showing 2 changed files with 75 additions and 0 deletions.
27 changes: 27 additions & 0 deletions tests/inputs/do.moon
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@

do
print "hello"
print "world"

x = do
print "hello"
print "world"

y = do
things = "shhh"
-> "hello: " .. things

-> if something then do "yeah"

t = {
y: do
number = 100
(x) -> x + number
}

(y=(do
x = 10 + 2
x), k=do
"nothing") -> do
"uhhh"

48 changes: 48 additions & 0 deletions tests/outputs/do.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
do
print("hello")
print("world")
end
local x
do
print("hello")
x = print("world")
end
local y
do
local things = "shhh"
y = function()
return "hello: " .. things
end
end
local _
_ = function()
if something then
do
return "yeah"
end
end
end
local t = {
y = (function()
local number = 100
return function(x)
return x + number
end
end)()
}
return function(y, k)
if y == nil then
y = ((function()
x = 10 + 2
return x
end)())
end
if k == nil then
do
k = "nothing"
end
end
do
return "uhhh"
end
end

0 comments on commit 0d1f25c

Please sign in to comment.