z_2_f_filetest.gno
0.70 Kb ยท 34 lines
1package main
2
3import (
4 "std"
5 "testing"
6
7 boards2 "gno.land/r/gnoland/boards2/v1"
8)
9
10const owner = std.Address("g16jpf0puufcpcjkph5nxueec8etpcldz7zwgydq") // @devx
11
12var (
13 bid boards2.BoardID
14 tid, rid boards2.PostID
15)
16
17func init() {
18 testing.SetRealm(std.NewUserRealm(owner))
19 bid = boards2.CreateBoard(cross, "test123", false)
20 tid = boards2.CreateThread(cross, bid, "Foo", "bar")
21 rid = boards2.CreateReply(cross, bid, tid, 0, "reply1")
22
23 // Hide thread by flagging it so reply of a reply can't be submitted
24 boards2.FlagThread(cross, bid, tid, "reason")
25}
26
27func main() {
28 testing.SetRealm(std.NewUserRealm(owner))
29
30 boards2.CreateReply(cross, bid, tid, rid, "reply1.1")
31}
32
33// Error:
34// thread is hidden