forked from mtusi2026/mtusi2026lab3
feat: add 5 experiment
This commit is contained in:
@@ -2,22 +2,12 @@ package tests
|
||||
|
||||
import (
|
||||
"context"
|
||||
"messenger/src/backend/services"
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/google/uuid"
|
||||
)
|
||||
|
||||
func TestMessageLessUsesIDForEqualTimestamps(t *testing.T) {
|
||||
createdAt := time.Date(2026, 9, 18, 12, 0, 0, 0, time.UTC)
|
||||
first := Message{ID: "a", CreatedAt: createdAt}
|
||||
second := Message{ID: "b", CreatedAt: createdAt}
|
||||
if !services.MessageLess(first, second) || services.MessageLess(second, first) {
|
||||
t.Fatal("equal timestamps must be ordered by ID")
|
||||
}
|
||||
}
|
||||
|
||||
func TestListPageByChatUsesCursorAndLimit(t *testing.T) {
|
||||
f := newTestFixture(t)
|
||||
user, _ := createTestUser(t, f.users, "alice", "Алиса")
|
||||
|
||||
@@ -7,6 +7,5 @@ import (
|
||||
|
||||
type User = repositories.User
|
||||
type Chat = repositories.Chat
|
||||
type Message = repositories.Message
|
||||
type messagePage = services.MessagePage
|
||||
type messageCursor = repositories.MessageCursor
|
||||
|
||||
Reference in New Issue
Block a user