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:
19
samples/Terra/splitprimary.t
Normal file
19
samples/Terra/splitprimary.t
Normal file
@@ -0,0 +1,19 @@
|
||||
r = 1
|
||||
local function foo(a)
|
||||
r = a
|
||||
return r
|
||||
end
|
||||
local b = foo(1)
|
||||
(foo)(3)
|
||||
assert(b + r == 4)
|
||||
|
||||
terra testescapes()
|
||||
var a = [4]
|
||||
[ quote
|
||||
a = a + 1
|
||||
end
|
||||
]
|
||||
return [ `&a ][0]
|
||||
end
|
||||
|
||||
assert(testescapes() == 5)
|
||||
Reference in New Issue
Block a user