z_2_m_filetest.gno

0.60 Kb ยท 31 lines
 1package main
 2
 3import (
 4	"std"
 5	"strings"
 6	"testing"
 7
 8	boards2 "gno.land/r/gnoland/boards2/v1"
 9)
10
11const owner = std.Address("g16jpf0puufcpcjkph5nxueec8etpcldz7zwgydq") // @devx
12
13var (
14	bid boards2.BoardID
15	tid boards2.PostID
16)
17
18func init() {
19	testing.SetRealm(std.NewUserRealm(owner))
20	bid = boards2.CreateBoard(cross, "test-board", false)
21	tid = boards2.CreateThread(cross, bid, "Foo", "bar")
22}
23
24func main() {
25	testing.SetRealm(std.NewUserRealm(owner))
26
27	boards2.CreateReply(cross, bid, tid, 0, strings.Repeat("x", boards2.MaxReplyLength+1))
28}
29
30// Error:
31// reply is too long, maximum allowed is 300 characters