github.com/gnolang/gno@v0.0.0-20240520182011-228e9d0192ce/gnovm/cmd/gno/lint_test.go (about) 1 package main 2 3 import "testing" 4 5 func TestLintApp(t *testing.T) { 6 tc := []testMainCase{ 7 { 8 args: []string{"lint"}, 9 errShouldBe: "flag: help requested", 10 }, { 11 args: []string{"lint", "--set-exit-status=0", "../../tests/integ/run_main/"}, 12 stderrShouldContain: "./../../tests/integ/run_main: missing 'gno.mod' file (code=1).", 13 }, { 14 args: []string{"lint", "--set-exit-status=0", "../../tests/integ/undefined_variable_test/undefined_variables_test.gno"}, 15 stderrShouldContain: "undefined_variables_test.gno:6: name toto not declared (code=2)", 16 }, { 17 args: []string{"lint", "--set-exit-status=0", "../../tests/integ/package_not_declared/main.gno"}, 18 stderrShouldContain: "main.gno:4: name fmt not declared (code=2).", 19 }, { 20 args: []string{"lint", "--set-exit-status=0", "../../tests/integ/run_main/"}, 21 stderrShouldContain: "./../../tests/integ/run_main: missing 'gno.mod' file (code=1).", 22 }, { 23 args: []string{"lint", "--set-exit-status=0", "../../tests/integ/minimalist_gnomod/"}, 24 // TODO: raise an error because there is a gno.mod, but no .gno files 25 }, { 26 args: []string{"lint", "--set-exit-status=0", "../../tests/integ/invalid_module_name/"}, 27 // TODO: raise an error because gno.mod is invalid 28 }, 29 30 // TODO: 'gno mod' is valid? 31 // TODO: is gno source valid? 32 // TODO: are dependencies valid? 33 // TODO: is gno source using unsafe/discouraged features? 34 // TODO: consider making `gno transpile; go lint *gen.go` 35 // TODO: check for imports of native libs from non _test.gno files 36 } 37 testMainCaseRun(t, tc) 38 }