z_create_repost_00_filetest.gno
0.88 Kb · 38 lines
1// PKGPATH: gno.land/r/gnoland/boards2/v1/filetests/z_create_repost_00_filetest
2
3package z_create_repost_00_filetest
4
5import (
6 "testing"
7
8 "gno.land/p/gnoland/boards"
9
10 boards2 "gno.land/r/gnoland/boards2/v1"
11)
12
13const owner address = "g1rp7cmetn27eqlpjpc4vuusf8kaj746tysc0qgh"
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