Initial open source release
This commit is contained in:
commit
74992e893f
377 changed files with 118084 additions and 0 deletions
27
internal/domain/message_test.go
Normal file
27
internal/domain/message_test.go
Normal 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)
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue