lang: Add a bunch of new language tests

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>
This commit is contained in:
James Shubin
2023-09-25 16:16:33 -04:00
parent d4b1e8f1be
commit 8d63b98212
74 changed files with 1001 additions and 686 deletions

View File

@@ -11,19 +11,13 @@ $out2 = $answer()
test $out1 + $out2 {}
-- OUTPUT --
Edge: call:answer() -> var(out1) # var:out1
Edge: call:answer() -> var(out2) # var:out2
Edge: func() { str("the answer is 42") } -> call:answer() # call:answer
Edge: func() { str("the answer is 42") } -> call:answer() # call:answer
Edge: str("+") -> call:_operator(str("+"), var(out1), var(out2)) # op
Edge: str("the answer is 42") -> func() { str("the answer is 42") } # body
Edge: var(out1) -> call:_operator(str("+"), var(out1), var(out2)) # a
Edge: var(out2) -> call:_operator(str("+"), var(out1), var(out2)) # b
Vertex: call:_operator(str("+"), var(out1), var(out2))
Vertex: call:answer()
Vertex: call:answer()
Vertex: func() { str("the answer is 42") }
Vertex: str("+")
Vertex: str("the answer is 42")
Vertex: var(out1)
Vertex: var(out2)
Edge: FuncValue -> call # fn
Edge: FuncValue -> call # fn
Edge: FuncValue -> call # fn
Vertex: FuncValue
Vertex: FuncValue
Vertex: FuncValue
Vertex: call
Vertex: call
Vertex: call
Vertex: const