package main import ( "std" "strings" "testing" boards2 "gno.land/r/gnoland/boards2/v1" ) const ( owner = std.Address("g16jpf0puufcpcjkph5nxueec8etpcldz7zwgydq") // @devx path = "test-board/1/2" comment = "Test comment" ) var ( bid boards2.BoardID tid boards2.PostID ) func init() { testing.SetRealm(std.NewUserRealm(owner)) bid = boards2.CreateBoard(cross, "test-board", false) tid = boards2.CreateThread(cross, bid, "Foo", "bar") } func main() { testing.SetRealm(std.NewUserRealm(owner)) rid := boards2.CreateReply(cross, bid, tid, 0, comment) // Ensure that returned ID is right println(rid == 2) // Render content must contain the reply content := boards2.Render(path) println(strings.Contains(content, "\n> "+comment+"\n")) } // Output: // true // true