These test both graph shape consistency and single value outputs. Eventually we want to make the graph shape tests more precise, and also verify specific outputs how it used to be. For now, this is okay. Co-authored-by: Samuel Gélineau <gelisam@gmail.com>
26 lines
496 B
Plaintext
26 lines
496 B
Plaintext
-- main.mcl --
|
|
import "fmt"
|
|
import "iter"
|
|
|
|
# function expression
|
|
$id1 = func($x str) { # definition site
|
|
$x
|
|
}
|
|
$id2 = func($x str) {
|
|
$x + $x
|
|
}
|
|
|
|
$generate = func($idn) {
|
|
$idn("foo") # 1 call site, 2 calls
|
|
}
|
|
|
|
$foo = iter.map([$id1, $id2,], $generate)
|
|
|
|
#test $foo[0] {}
|
|
#test $foo[1] {}
|
|
test listlookup($foo, 0, "fail") {} # TODO: add syntactic sugar for listlookup
|
|
test listlookup($foo, 1, "fail") {} # TODO: add syntactic sugar for listlookup
|
|
-- OUTPUT --
|
|
Vertex: test[foo]
|
|
Vertex: test[foofoo]
|