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>
66 lines
1.3 KiB
Plaintext
66 lines
1.3 KiB
Plaintext
-- main.mcl --
|
|
import "fmt"
|
|
|
|
# this value should only be built once
|
|
$some_value1 = 42 # or something more complex like the output of a slow function...
|
|
class foo($num) {
|
|
# we should have a different `$inside` value for each use of this class
|
|
$inside = $some_value1 + $some_value2 + 4
|
|
test fmt.printf("test-%d-%d", $num, $inside) {} # some resource
|
|
}
|
|
$some_value2 = 13 # check that non-ordering works too!
|
|
|
|
# We *don't* unnecessarily copy `4` on each include, because it's static!
|
|
include foo(1)
|
|
include foo(2)
|
|
include foo(3)
|
|
-- OUTPUT --
|
|
Edge: FuncValue -> call # fn
|
|
Edge: FuncValue -> call # fn
|
|
Edge: FuncValue -> call # fn
|
|
Edge: FuncValue -> call # fn
|
|
Edge: FuncValue -> call # fn
|
|
Edge: FuncValue -> call # fn
|
|
Edge: FuncValue -> call # fn
|
|
Edge: FuncValue -> call # fn
|
|
Edge: FuncValue -> call # fn
|
|
Vertex: FuncValue
|
|
Vertex: FuncValue
|
|
Vertex: FuncValue
|
|
Vertex: FuncValue
|
|
Vertex: FuncValue
|
|
Vertex: FuncValue
|
|
Vertex: FuncValue
|
|
Vertex: FuncValue
|
|
Vertex: FuncValue
|
|
Vertex: call
|
|
Vertex: call
|
|
Vertex: call
|
|
Vertex: call
|
|
Vertex: call
|
|
Vertex: call
|
|
Vertex: call
|
|
Vertex: call
|
|
Vertex: call
|
|
Vertex: const
|
|
Vertex: const
|
|
Vertex: const
|
|
Vertex: const
|
|
Vertex: const
|
|
Vertex: const
|
|
Vertex: const
|
|
Vertex: const
|
|
Vertex: const
|
|
Vertex: const
|
|
Vertex: const
|
|
Vertex: const
|
|
Vertex: const
|
|
Vertex: const
|
|
Vertex: const
|
|
Vertex: const
|
|
Vertex: const
|
|
Vertex: const
|
|
Vertex: const
|
|
Vertex: const
|
|
Vertex: const
|