Now works with tests

This commit is contained in:
Sasha Koshka 2022-09-05 13:42:17 -04:00
parent 2e79d9c834
commit 49bcbcaa96
2 changed files with 7 additions and 3 deletions

View File

@ -20,7 +20,7 @@ type ParsingOperation struct {
// TODO:
// * implement parser cache
// * have this try to hit the cache, and actually parse on miss
// - rename this to Fetch
// * rename this to Fetch
// - add `skim bool` argument. when this is true, don't parse any code or data
// section initialization values, just definitions and their default values.

View File

@ -1,12 +1,16 @@
package parser
import "io"
import "os"
import "strings"
import "testing"
// import "git.tebibyte.media/arf/arf/types"
import "path/filepath"
func checkTree (modulePath string, correct string, test *testing.T) {
tree, err := Parse(modulePath)
cwd, _ := os.Getwd()
modulePath = filepath.Join(cwd, modulePath)
println(modulePath)
tree, err := Fetch(modulePath)
treeString := tree.ToString(0)
treeRunes := []rune(treeString)