Search Apps Documentation Source Content File Folder Download Copy Actions Download

z_9_a_filetest.gno

0.67 Kb ยท 38 lines
 1package main
 2
 3import (
 4	"testing"
 5
 6	"gno.land/p/gnoland/boards"
 7
 8	boards2 "gno.land/r/boards000/v1rc1"
 9)
10
11const (
12	owner address = "g16jpf0puufcpcjkph5nxueec8etpcldz7zwgydq" // @devx
13	title         = "Test Thread"
14	body          = "Test body"
15)
16
17var (
18	bid boards.ID
19	pid boards.ID
20)
21
22func init() {
23	testing.SetRealm(testing.NewUserRealm(owner))
24	bid = boards2.CreateBoard(cross, "test-board", false)
25	pid = boards2.CreateThread(cross, bid, title, body)
26}
27
28func main() {
29	testing.SetRealm(testing.NewUserRealm(owner))
30
31	boards2.DeleteThread(cross, bid, pid)
32
33	// Ensure thread doesn't exist
34	println(boards2.Render("test-board/1"))
35}
36
37// Output:
38// Thread does not exist with ID: 1