Search Apps Documentation Source Content File Folder Download Copy Actions Download

z_create_repost_01_filetest.gno

0.79 Kb · 35 lines
 1// PKGPATH: gno.land/r/gnoland/boards2/v1/filetests/z_create_repost_01_filetest
 2
 3package z_create_repost_01_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 = 1024
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
27func main(cur realm) {
28	testing.SetRealm(testing.NewUserRealm(owner))
29
30	// Repost should fail if source thread doesn't exist
31	boards2.CreateRepost(cross(cur), srcBID, srcTID, dstBID, "foo", "bar")
32}
33
34// Error:
35// thread does not exist with ID: 1024