forked from gnolang/gno
-
Notifications
You must be signed in to change notification settings - Fork 0
/
run_test.go
37 lines (35 loc) · 1.05 KB
/
run_test.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
package main
import "testing"
func TestRunApp(t *testing.T) {
tc := []testMainCase{
{
args: []string{"run"},
errShouldBe: "flag: help requested",
},
{
args: []string{"run", "../../tests/integ/run-main/main.gno"},
stdoutShouldContain: "hello world!",
},
{
args: []string{"run", "../../tests/integ/run-main/"},
recoverShouldContain: "read ../../tests/integ/run-main/: is a directory", // FIXME: should work
},
{
args: []string{"run", "../../tests/integ/does-not-exist"},
recoverShouldContain: "open ../../tests/integ/does-not-exist: no such file or directory",
},
{
args: []string{"run", "../../tests/integ/run-namedpkg/main.gno"},
recoverShouldContain: "expected package name [main] but got [namedpkg]", // FIXME: should work
},
// TODO: multiple files
// TODO: a test file
// TODO: a file without main
// TODO: args
// TODO: nativeLibs VS stdlibs
// TODO: with gas meter
// TODO: verbose
// TODO: logging
}
testMainCaseRun(t, tc)
}