z_11_h_filetest.gno

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