z_2_k_filetest.gno
0.76 Kb ยท 38 lines
1package main
2
3import (
4 "testing"
5
6 "gno.land/p/gnoland/boards"
7
8 boards2 "gno.land/r/boards000/v1rc1"
9)
10
11const (
12 owner address = "g16jpf0puufcpcjkph5nxueec8etpcldz7zwgydq" // @devx
13 comment = "Second comment"
14)
15
16var (
17 bid boards.ID
18 tid, rid boards.ID
19)
20
21func init() {
22 testing.SetRealm(testing.NewUserRealm(owner))
23 bid = boards2.CreateBoard(cross, "test-board", false)
24 tid = boards2.CreateThread(cross, bid, "Foo", "bar")
25 rid = boards2.CreateReply(cross, bid, tid, 0, "Parent comment")
26
27 // Flag parent post so it's hidden
28 boards2.FlagReply(cross, bid, tid, rid, "")
29}
30
31func main() {
32 testing.SetRealm(testing.NewUserRealm(owner))
33
34 boards2.CreateReply(cross, bid, tid, rid, "Sub comment")
35}
36
37// Error:
38// replying to a hidden or frozen reply is not allowed