z_create_repost_00_filetest.gno
0.88 Kb · 38 lines
1// PKGPATH: gno.land/r/gnoland/boards2/v0/filetests/z_create_repost_00_filetest
2
3package z_create_repost_00_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 srcBID boards.ID
17 dstBID boards.ID
18 srcTID boards.ID
19)
20
21func init(cur realm) {
22 testing.SetRealm(testing.NewUserRealm(owner))
23 srcBID = boards2.CreateBoard(cross(cur), "src-board", false, false)
24 dstBID = boards2.CreateBoard(cross(cur), "dst-board", false, false)
25
26 srcTID = boards2.CreateThread(cross(cur), srcBID, "Foo", "bar")
27 boards2.FlagThread(cross(cur), srcBID, srcTID, "idk")
28}
29
30func main(cur realm) {
31 testing.SetRealm(testing.NewUserRealm(owner))
32
33 // Repost should fail if source thread is flagged
34 boards2.CreateRepost(cross(cur), srcBID, srcTID, dstBID, "foo", "bar")
35}
36
37// Error:
38// thread is hidden