Search Apps Documentation Source Content File Folder Download Copy Actions Download

z_edit_thread_07_filetest.gno

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