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:
33
samples/Terra/logical.t
Normal file
33
samples/Terra/logical.t
Normal file
@@ -0,0 +1,33 @@
|
||||
|
||||
|
||||
local T = true
|
||||
local F = false
|
||||
|
||||
terra check()
|
||||
var a = true
|
||||
return not true == false
|
||||
end
|
||||
|
||||
assert(check() == true)
|
||||
|
||||
terra check2()
|
||||
return not T == F
|
||||
end
|
||||
|
||||
assert(check2() == true)
|
||||
|
||||
terra check3()
|
||||
return not T == not not T
|
||||
end
|
||||
|
||||
assert(check3() == false)
|
||||
|
||||
terra check4()
|
||||
return not not T == T and not not F == F and true == T and false == F
|
||||
end
|
||||
|
||||
assert(check4() == true)
|
||||
|
||||
terra foo() return not false end
|
||||
|
||||
assert(foo() == true)
|
||||
Reference in New Issue
Block a user