z_11_h_filetest.gno

0.63 Kb ยท 32 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	pid   boards2.PostID
16	title = strings.Repeat("X", boards2.MaxThreadTitleLength+1)
17)
18
19func init() {
20	testing.SetRealm(std.NewUserRealm(owner))
21	bid = boards2.CreateBoard(cross, "test-board", false)
22	pid = boards2.CreateThread(cross, bid, "Foo", "bar")
23}
24
25func main() {
26	testing.SetRealm(std.NewUserRealm(owner))
27
28	boards2.EditThread(cross, bid, pid, title, "bar")
29}
30
31// Error:
32// thread title is too long, maximum allowed is 100 characters