Skip to content Search Apps Documentation Source Content Run Reset Eval Playground File Folder Download Copy Actions State String Boolean Number Struct Map Slice Pointer Function Closure Reference Nil Package Type Interface Unknown

z_flag_reply_04_filetest.gno

0.81 Kb · 35 lines
 1// PKGPATH: gno.land/r/gnoland/boards2/v0/filetests/z_flag_reply_04_filetest
 2
 3package z_flag_reply_04_filetest
 4
 5import (
 6	"testing"
 7
 8	"gno.land/p/gnoland/boards/v0"
 9
10	boards2 "gno.land/r/gnoland/boards2/v0"
11)
12
13const owner address = "g1skl80cuz8zq3lul9pgz5pc35l2pfzgxgfpsqkx"
14
15var (
16	bid      boards.ID
17	rid, tid boards.ID
18)
19
20func init(cur realm) {
21	testing.SetRealm(testing.NewUserRealm(owner))
22	bid = boards2.CreateBoard(cross(cur), "test-board", false, false)
23	tid = boards2.CreateThread(cross(cur), bid, "Foo", "bar")
24	rid = boards2.CreateReply(cross(cur), bid, tid, 0, "body")
25	boards2.FlagReply(cross(cur), bid, tid, rid, "Reason")
26}
27
28func main(cur realm) {
29	testing.SetRealm(testing.NewUserRealm(owner))
30
31	boards2.FlagReply(cross(cur), bid, tid, rid, "Reason")
32}
33
34// Error:
35// flagging hidden comments or replies is not allowed