Added tests for examples

This commit is contained in:
2024-06-29 21:40:14 +02:00
parent 83640ba590
commit 6e1af81733
4 changed files with 87 additions and 3 deletions

View File

@ -63,3 +63,9 @@ func (r *Result) EachFunction(caller *Function, traversed map[*Function]bool, ca
r.EachFunction(callee, traversed, call)
}
}
// Write write the final executable to disk.
func (r *Result) Write(path string) error {
code, data := r.Finalize()
return Write(path, code, data)
}

View File

@ -53,9 +53,7 @@ func Build(args []string) int {
return 0
}
path := b.Executable()
code, data := result.Finalize()
err = build.Write(path, code, data)
err = result.Write(b.Executable())
if err != nil {
fmt.Fprintln(os.Stderr, err)