Add test contract
This commit is contained in:
parent
66528c8a6a
commit
ff11943576
47
test/contracts/funargs.aes
Normal file
47
test/contracts/funargs.aes
Normal file
@ -0,0 +1,47 @@
|
|||||||
|
|
||||||
|
contract FunctionArguments =
|
||||||
|
|
||||||
|
function sum(n : int, m: int) =
|
||||||
|
n + m
|
||||||
|
|
||||||
|
function append(xs : list(string)) =
|
||||||
|
switch(xs)
|
||||||
|
[] => ""
|
||||||
|
y :: ys => String.concat(y, append(ys))
|
||||||
|
|
||||||
|
function menot(b) =
|
||||||
|
!b
|
||||||
|
|
||||||
|
function bitsum(b : bits) =
|
||||||
|
Bits.sum(b)
|
||||||
|
|
||||||
|
record answer('a) = {label : string, result : 'a}
|
||||||
|
|
||||||
|
function read(a : answer(int)) =
|
||||||
|
a.result
|
||||||
|
|
||||||
|
function sjutton(b : bytes(17)) =
|
||||||
|
b
|
||||||
|
|
||||||
|
function sextiosju(b : bytes(67)) =
|
||||||
|
b
|
||||||
|
|
||||||
|
function trettiotva(b : bytes(32)) =
|
||||||
|
b
|
||||||
|
|
||||||
|
function find_oracle(o : oracle(int, bool)) =
|
||||||
|
true
|
||||||
|
|
||||||
|
function find_query(q : oracle_query(int, bool)) =
|
||||||
|
true
|
||||||
|
|
||||||
|
datatype colour() = Green | Yellow | Red | Pantone(int)
|
||||||
|
|
||||||
|
function traffic_light(c : colour) =
|
||||||
|
Red
|
||||||
|
|
||||||
|
function tuples(t : ()) =
|
||||||
|
t
|
||||||
|
|
||||||
|
function due(t : Chain.ttl) =
|
||||||
|
true
|
Loading…
x
Reference in New Issue
Block a user