Fail test on nil tree

This commit is contained in:
Sasha Koshka 2022-09-01 18:02:14 -04:00
parent 8d46188f6c
commit aec266a82e
1 changed files with 6 additions and 0 deletions

View File

@ -7,6 +7,12 @@ import "testing"
func checkTree (modulePath string, correct string, test *testing.T) {
tree, err := Parse(modulePath)
if tree == nil {
test.Log("TREE IS NIL!")
test.Fail()
return
}
treeString := tree.ToString(0)
treeRunes := []rune(treeString)