diff --git a/gnovm/cmd/gno/lint_test.go b/gnovm/cmd/gno/lint_test.go index ce200a1fedd..77b7e3a15d4 100644 --- a/gnovm/cmd/gno/lint_test.go +++ b/gnovm/cmd/gno/lint_test.go @@ -13,6 +13,9 @@ func TestLintApp(t *testing.T) { }, { args: []string{"lint", "--set_exit_status=0", "../../tests/integ/run-main/"}, stderrShouldContain: "./../../tests/integ/run-main: missing 'gno.mod' file (code=1).", + }, { + args: []string{"lint", "--set_exit_status=0", "../../tests/integ/package-not-declared/main.gno"}, + stderrShouldContain: "main.gno:4: name fmt not declared (code=2).", }, { args: []string{"lint", "--set_exit_status=0", "../../tests/integ/minimalist-gnomod/"}, // TODO: raise an error because there is a gno.mod, but no .gno files @@ -20,6 +23,7 @@ func TestLintApp(t *testing.T) { args: []string{"lint", "--set_exit_status=0", "../../tests/integ/invalid-module-name/"}, // TODO: raise an error because gno.mod is invalid }, + // TODO: 'gno mod' is valid? // TODO: is gno source valid? // TODO: are dependencies valid? diff --git a/gnovm/tests/integ/package-not-declared/gno.mod b/gnovm/tests/integ/package-not-declared/gno.mod new file mode 100644 index 00000000000..8b4e0375297 --- /dev/null +++ b/gnovm/tests/integ/package-not-declared/gno.mod @@ -0,0 +1 @@ +module gno.land/tests/nodeclared \ No newline at end of file diff --git a/gnovm/tests/integ/package-not-declared/main.gno b/gnovm/tests/integ/package-not-declared/main.gno new file mode 100644 index 00000000000..bdbb2e7cfcb --- /dev/null +++ b/gnovm/tests/integ/package-not-declared/main.gno @@ -0,0 +1,5 @@ +package main + +func Main() { + fmt.Println("hello world") +}