Search Apps Documentation Source Content File Folder Download Copy Actions Download

z_11_h_filetest.gno

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