Skip to content Search Apps Documentation Source Content Run Reset Eval Playground File Folder Download Copy Actions State String Boolean Number Struct Map Slice Pointer Function Closure Reference Nil Package Type Interface Unknown

z_hub_5_a_filetest.gno

0.72 Kb · 29 lines
 1// PKGPATH: gno.land/r/gnoland/boards2/v0/filetests/z_hub_5_a_filetest
 2
 3// Test getting reposts from a thread without reposts
 4package z_hub_5_a_filetest
 5
 6import (
 7	"testing"
 8
 9	boards2 "gno.land/r/gnoland/boards2/v0"
10)
11
12var thread boards2.Thread
13
14func init(cur realm) {
15	testing.SetRealm(testing.NewUserRealm("g1skl80cuz8zq3lul9pgz5pc35l2pfzgxgfpsqkx"))
16	boardID := boards2.CreateBoard(cross(cur), "aaa123", false, false)
17	threadID := boards2.CreateThread(cross(cur), boardID, "Title", "Body")
18
19	// Get readonly thread
20	thread, _ = boards2.GetThread(uint64(boardID), uint64(threadID))
21}
22
23func main(cur realm) {
24	reposts := boards2.GetReposts(thread.BoardID(), thread.ID(), 0, thread.RepostCount())
25	println(len(reposts))
26}
27
28// Output:
29// 0