z_9_b_filetest.gno

0.67 Kb ยท 34 lines
 1// PKGPATH: gno.land/r/demo/boards_test
 2package boards_test
 3
 4// SEND: 200000000ugnot
 5
 6import (
 7	"std"
 8
 9	"gno.land/p/demo/testutils"
10	"gno.land/r/demo/boards"
11	"gno.land/r/demo/users"
12)
13
14var (
15	srcBoard boards.BoardID
16	pid      boards.PostID
17)
18
19func init() {
20	caller := testutils.TestAddress("caller")
21	std.TestSetRealm(std.NewUserRealm(caller))
22	users.Register("", "gnouser", "my profile")
23
24	srcBoard = boards.CreateBoard("first_board")
25	pid = boards.CreateThread(srcBoard, "First Post in (title)", "Body of the first post. (body)")
26
27	boards.CreateRepost(srcBoard, pid, "First Post in (title)", "Body of the first post. (body)", 0)
28}
29
30func main() {
31}
32
33// Error:
34// dst board not exist