mirror of
https://github.com/KevinMidboe/linguist.git
synced 2025-10-29 17:50:22 +00:00
samples: add Terra samples
source: https://github.com/zdevito/terra/tree/master/tests
This commit is contained in:
18
samples/Terra/zeroreturn.t
Normal file
18
samples/Terra/zeroreturn.t
Normal file
@@ -0,0 +1,18 @@
|
||||
|
||||
|
||||
local b = global(0)
|
||||
|
||||
terra foo(a : int)
|
||||
if a > 3 then
|
||||
return
|
||||
end
|
||||
b = a
|
||||
end
|
||||
|
||||
terra getb() return b end
|
||||
|
||||
local test = require("test")
|
||||
foo(4)
|
||||
test.eq(getb(),0)
|
||||
foo(2)
|
||||
test.eq(getb(),2)
|
||||
Reference in New Issue
Block a user