Search Apps Documentation Source Content File Folder Download Copy

z_7_filetest.gno

0.81 Kb ยท 33 lines
 1// PKGPATH: gno.land/r/demo/boards_test
 2package boards_test
 3
 4// SEND: 200000000ugnot
 5
 6import (
 7	"gno.land/r/demo/boards"
 8	"gno.land/r/demo/users"
 9)
10
11func init() {
12	// register
13	users.Register("", "gnouser", "my profile")
14
15	// create board and post
16	bid := boards.CreateBoard("test_board")
17	boards.CreateThread(bid, "First Post (title)", "Body of the first post. (body)")
18}
19
20func main() {
21	println(boards.Render("test_board"))
22}
23
24// Output:
25// \[[post](/r/demo/boards$help&func=CreateThread&bid=1)]
26//
27// ----------------------------------------
28// ## [First Post (title)](/r/demo/boards:test_board/1)
29//
30// Body of the first post. (body)
31// \- [@gnouser](/r/demo/users:gnouser), [2009-02-13 11:31pm UTC](/r/demo/boards:test_board/1) \[[x](/r/demo/boards$help&func=DeletePost&bid=1&threadid=1&postid=1)] (0 replies) (0 reposts)
32//
33//