mirror of
https://github.com/KevinMidboe/linguist.git
synced 2026-01-18 15:25:42 +00:00
samples: add Terra samples
source: https://github.com/zdevito/terra/tree/master/tests
This commit is contained in:
15
samples/Terra/symparam3.t
Normal file
15
samples/Terra/symparam3.t
Normal file
@@ -0,0 +1,15 @@
|
||||
|
||||
local a = symbol(int)
|
||||
local c = {}
|
||||
terra foo([a], b : int, [c])
|
||||
return [a] + b
|
||||
end
|
||||
local d = {symbol(int),symbol(int)}
|
||||
terra foo2([a], b : int, [d])
|
||||
return [a] + b + [d[1]] + [d[2]]
|
||||
end
|
||||
|
||||
local test = require("test")
|
||||
|
||||
test.eq(foo2(1,2,3,4),10)
|
||||
test.eq(foo(1,2),3)
|
||||
Reference in New Issue
Block a user