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