1// PKGPATH: gno.land/r/demo/boards_test
2package boards_test
3
4// SEND: 200000000ugnot
5
6import (
7 "strconv"
8
9 "gno.land/r/demo/boards"
10 "gno.land/r/demo/users"
11)
12
13var (
14 bid boards.BoardID
15 pid boards.PostID
16)
17
18func init() {
19 users.Register("", "gnouser", "my profile")
20
21 bid = boards.CreateBoard("test_board")
22 pid = boards.CreateThread(bid, "First Post in (title)", "Body of the first post. (body)")
23}
24
25func main() {
26 println(boards.Render("test_board/" + strconv.Itoa(int(pid))))
27 // boardId 2 not exist
28 boards.DeletePost(2, pid, pid, "")
29 println("----------------------------------------------------")
30 println(boards.Render("test_board/" + strconv.Itoa(int(pid))))
31}
32
33// Error:
34// board not exist
z_10_a_filetest.gno
0.69 Kb ยท 34 lines