Skip to content

Commit

Permalink
feat: issue warning when gno test package can't be resolved (gnolang#…
Browse files Browse the repository at this point in the history
…1845)

Pretty straightforward one line change. If `gno test` fails to find a
gno.mod field or package path in gno root, the result will be a panic
with the message `panic: unexpected unreal object`, which makes it
pretty difficult to figure out what must be done to correct the issue.
The warning gives a solution on how to fix this.
  • Loading branch information
deelawn authored Mar 27, 2024
1 parent 55056c5 commit 0c121a6
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions gnovm/cmd/gno/test.go
Original file line number Diff line number Diff line change
Expand Up @@ -318,6 +318,7 @@ func gnoTestPkg(
gnoPkgPath = pkgPathFromRootDir(pkgPath, rootDir)
if gnoPkgPath == "" {
// unable to read pkgPath from gno.mod, generate a random realm path
io.ErrPrintfln("--- WARNING: unable to read package path from gno.mod or gno root directory; try creating a gno.mod file")
gnoPkgPath = transpiler.GnoRealmPkgsPrefixBefore + random.RandStr(8)
}
}
Expand Down

0 comments on commit 0c121a6

Please sign in to comment.