Search Apps Documentation Source Content File Folder Download Copy Actions Download

z_0_c_filetest.gno

0.61 Kb · 26 lines
 1// PKGPATH: gno.land/r/archive/boards_test
 2package boards_test
 3
 4// SEND: 1000000ugnot
 5
 6import (
 7	"testing"
 8
 9	"gno.land/r/archive/boards"
10	uinit "gno.land/r/sys/users/init"
11)
12
13var bid boards.BoardID
14
15func init() {
16	testing.SetRealm(testing.NewUserRealm(address("g1wymu47drhr0kuq2098m792lytgtj2nyx77yrsm"))) // so that CurrentRealm.Addr() matches OrigCaller
17	uinit.RegisterUser(cross, "gnouser123", address("g1wymu47drhr0kuq2098m792lytgtj2nyx77yrsm"))
18	boards.CreateThread(cross, 1, "First Post (title)", "Body of the first post. (body)")
19}
20
21func main() {
22	println(boards.Render("test_board"))
23}
24
25// Error:
26// board not exist