Search Apps Documentation Source Content File Folder Download Copy Actions Download

z_0_a_filetest.gno

0.67 Kb · 29 lines
 1// PKGPATH: gno.land/r/archive/boards_test
 2package boards_test
 3
 4// SEND: 1000000ugnot
 5
 6import (
 7	"testing"
 8
 9	"gno.land/p/nt/testutils/v0"
10	"gno.land/r/archive/boards"
11)
12
13var bid boards.BoardID
14
15func init() {
16	caller := testutils.TestAddress("caller")
17	testing.SetRealm(testing.NewUserRealm(caller))
18	bid = boards.CreateBoard(cross, "test_board")
19	boards.CreateThread(cross, bid, "First Post (title)", "Body of the first post. (body)")
20	pid := boards.CreateThread(cross, bid, "Second Post (title)", "Body of the second post. (body)")
21	boards.CreateReply(cross, bid, pid, pid, "Reply of the second post")
22}
23
24func main() {
25	println(boards.Render("test_board"))
26}
27
28// Error:
29// unauthorized