test: add resilience and benchmark verification

This commit is contained in:
2026-09-24 10:50:50 +03:00
parent 872b69f90e
commit 1f511728c9
13 changed files with 1203 additions and 0 deletions
+18
View File
@@ -0,0 +1,18 @@
package model
import (
"encoding/json"
"testing"
"time"
)
func TestUserTimestampHasFixedMicroseconds(t *testing.T) {
createdAt := time.Date(2026, time.September, 23, 21, 28, 15, 423030000, time.UTC)
data, err := json.Marshal(User{ID: "id", Username: "user", DisplayName: "User", CreatedAt: createdAt})
if err != nil {
t.Fatalf("Marshal() error = %v", err)
}
if string(data) != `{"id":"id","username":"user","display_name":"User","created_at":"2026-09-23T21:28:15.423030Z"}` {
t.Fatalf("Marshal() = %s", data)
}
}