z_15_b_filetest.gno
0.64 Kb ยท 31 lines
1package main
2
3import (
4 "testing"
5
6 boards2 "gno.land/r/gnoland/boards2/v1"
7)
8
9const owner = address("g16jpf0puufcpcjkph5nxueec8etpcldz7zwgydq") // @devx
10
11var (
12 srcBID boards2.BoardID
13 dstBID boards2.BoardID
14 srcTID boards2.PostID = 1024
15)
16
17func init() {
18 testing.SetRealm(testing.NewUserRealm(owner))
19 srcBID = boards2.CreateBoard(cross, "src-board", false)
20 dstBID = boards2.CreateBoard(cross, "dst-board", false)
21}
22
23func main() {
24 testing.SetRealm(testing.NewUserRealm(owner))
25
26 // Repost should fail if source thread doesn't exist
27 boards2.CreateRepost(cross, srcBID, srcTID, "foo", "bar", dstBID)
28}
29
30// Error:
31// thread does not exist with ID: 1024