diff --git a/gnovm/cmd/gno/testdata/gno_precompile/03_invalid_gno_files.txtar b/gnovm/cmd/gno/testdata/gno_precompile/03_gno_files_parse_error.txtar similarity index 65% rename from gnovm/cmd/gno/testdata/gno_precompile/03_invalid_gno_files.txtar rename to gnovm/cmd/gno/testdata/gno_precompile/03_gno_files_parse_error.txtar index 26e12a9c750..f4cd79c1db5 100644 --- a/gnovm/cmd/gno/testdata/gno_precompile/03_invalid_gno_files.txtar +++ b/gnovm/cmd/gno/testdata/gno_precompile/03_gno_files_parse_error.txtar @@ -1,4 +1,4 @@ -# Run gno precompile with invalid gno files +# Run gno precompile with gno files with parse errors ! gno precompile . @@ -6,6 +6,10 @@ stderr 'precompile: parse: main.gno:3:1: expected declaration, found invalid' stderr 'precompile: parse: sub/sub.gno:3:1: expected declaration, found invalid' +# no *.gen.go files are created +! exec test -f main.gno.gen.go +! exec test -f sub/sub.gno.gen.go + -- main.gno -- package main diff --git a/gnovm/cmd/gno/testdata/gno_precompile/08_build_flag_with_parse_error.txtar b/gnovm/cmd/gno/testdata/gno_precompile/08_build_flag_with_parse_error.txtar new file mode 100644 index 00000000000..4d2b5ad8041 --- /dev/null +++ b/gnovm/cmd/gno/testdata/gno_precompile/08_build_flag_with_parse_error.txtar @@ -0,0 +1,14 @@ +# Run gno precompile with -gobuild flag on file with parse error + +! gno precompile -gobuild . + +! stdout .+ +stderr 'main.gno: precompile: parse: main.gno:3:1: expected declaration, found invalid' + +# no *.gen.go files are created +! exec test -f main.gno.gen.go + +-- main.gno -- +package main + +invalid diff --git a/gnovm/cmd/gno/testdata/gno_precompile/09_gno_files_whitelist_error.txtar b/gnovm/cmd/gno/testdata/gno_precompile/09_gno_files_whitelist_error.txtar new file mode 100644 index 00000000000..f2386716ce6 --- /dev/null +++ b/gnovm/cmd/gno/testdata/gno_precompile/09_gno_files_whitelist_error.txtar @@ -0,0 +1,26 @@ +# Run gno precompile with gno files with whitelist errors + +! gno precompile . + +! stdout .+ +stderr 'main.gno: precompile: import "xxx" is not in the whitelist' +stderr 'sub/sub.gno: precompile: import "xxx" is not in the whitelist' + +# no *.gen.go files are created +! exec test -f main.gno.gen.go +! exec test -f sub/sub.gno.gen.go + +-- main.gno -- +package main + +import ( + "std" + "xxx" +) + +func main() {} + +-- sub/sub.gno -- +package sub + +import "xxx"