1package boards_test23import (4 "strings"5 "testing"67 "gno.land/p/nt/urequire/v0"89 "gno.land/p/gnoland/boards/v0"10)1112func TestPostSummary(t *testing.T) {13 post := &boards.Post{ID: 1, Body: strings.Repeat("X", 900)}14 summary := post.Summary()15 urequire.True(t, strings.HasSuffix(summary, "..."), "expect dotted suffix")16 urequire.True(t, len(summary) == 80, "expect summary length to match")17}1819func TestIsThread(t *testing.T) {20 post := &boards.Post{ID: 1, ThreadID: 1} // IDs match21 urequire.True(t, boards.IsThread(post), "expect post to be a thread")22 urequire.False(t, boards.IsThread(nil), "expect nil not to be a thread")2324 post = &boards.Post{ID: 2, ThreadID: 1} // IDs doesn't match25 urequire.False(t, boards.IsThread(post), "expect post not to be a thread")26}2728func TestIsRepost(t *testing.T) {29 post := &boards.Post{ID: 1, OriginalBoardID: 1} // Original board ID available30 urequire.True(t, boards.IsRepost(post), "expect post to be a repost")31 urequire.False(t, boards.IsRepost(nil), "expect nil not to be a repost")3233 post = &boards.Post{ID: 1} // Original board ID not available34 urequire.False(t, boards.IsRepost(post), "expect post not to be a repost")35}3637func TestSummaryOf(t *testing.T) {38 summary := boards.SummaryOf(strings.Repeat("X", 90), 80)39 urequire.True(t, strings.HasSuffix(summary, "..."), "expect dotted suffix")40 urequire.True(t, len(summary) == 80, "expect summary length to match")4142 summary = boards.SummaryOf(strings.Repeat(" ", 90), 80)43 urequire.Empty(t, summary, "expect summary to be empty")44}45Signatures reconstructed verbatim from vm/qfuncs — interface params keep their inline definitions.