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