z_12_b_filetest.gno
0.76 Kb · 26 lines
1package main
2
3// SEND: 1000000ugnot
4
5import (
6 "testing"
7
8 "gno.land/r/archive/boards"
9 uinit "gno.land/r/sys/users/init"
10)
11
12func main() {
13 testing.SetRealm(testing.NewUserRealm(address("g1wymu47drhr0kuq2098m792lytgtj2nyx77yrsm"))) // so that CurrentRealm.Addr() matches OrigCaller
14 uinit.RegisterUser(cross, "gnouser123", address("g1wymu47drhr0kuq2098m792lytgtj2nyx77yrsm"))
15 bid1 := boards.CreateBoard(cross, "test_board1")
16 pid := boards.CreateThread(cross, bid1, "First Post (title)", "Body of the first post. (body)")
17 bid2 := boards.CreateBoard(cross, "test_board2")
18
19 // create a repost to a non-existing board
20 rid := boards.CreateRepost(cross, 5, pid, "", "Check this out", bid2)
21 println(rid)
22 println(boards.Render("test_board1"))
23}
24
25// Error:
26// src board not exist