// PKGPATH: gno.land/r/boards_test
package boards_test
// SEND: 2000000000ugnot
import (
"strconv"
"gno.land/r/demo/boards"
"gno.land/r/demo/users"
)
var (
bid boards.BoardID
pid boards.PostID
)
func init() {
users.Register("", "gnouser", "my profile")
bid = boards.CreateBoard("test_board")
pid = boards.CreateThread(bid, "First Post in (title)", "Body of the first post. (body)")
}
func main() {
println(boards.Render("test_board/" + strconv.Itoa(int(pid))))
// post 2 not exist
boards.EditPost(bid, pid, 2, "Edited: First Post in (title)", "Edited: Body of the first post. (body)")
println("----------------------------------------------------")
println(boards.Render("test_board/" + strconv.Itoa(int(pid))))
}
// Error:
// post not exist