Initial open source release

This commit is contained in:
A 2026-06-04 01:37:39 +08:00
commit 74992e893f
377 changed files with 118084 additions and 0 deletions

View file

@ -0,0 +1,27 @@
package domain
import (
"errors"
"testing"
)
func TestValidateMessageReplyBoundsRejectsQuoteOffsetAsTextOffset(t *testing.T) {
reply := &MessageReply{
MessageID: 1,
QuoteText: "hello",
QuoteOffset: MaxMessageReplyQuoteOffset + 1,
}
if err := ValidateMessageReplyBounds(reply); !errors.Is(err, ErrReplyMessageIDInvalid) {
t.Fatalf("ValidateMessageReplyBounds err = %v, want ErrReplyMessageIDInvalid", err)
}
}
func TestValidateMessageReplyBoundsAllowsForumTopicOnlyHeader(t *testing.T) {
reply := &MessageReply{
TopMessageID: 10,
ForumTopic: true,
}
if err := ValidateMessageReplyBounds(reply); err != nil {
t.Fatalf("ValidateMessageReplyBounds err = %v, want nil", err)
}
}