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 = "Second comment" ) var ( bid boards2.BoardID tid, rid boards2.PostID ) func init() { testing.SetRealm(std.NewUserRealm(owner)) bid = boards2.CreateBoard(cross, "test-board", false) tid = boards2.CreateThread(cross, bid, "Foo", "bar") rid = boards2.CreateReply(cross, bid, tid, 0, "First comment") } func main() { testing.SetRealm(std.NewUserRealm(owner)) rid2 := boards2.CreateReply(cross, bid, tid, rid, comment) // Ensure that returned ID is right println(rid2 == 3) // Render content must contain the sub-reply content := boards2.Render(path) println(strings.Contains(content, "\n> > "+comment+"\n")) } // Output: // true // true