MCPcopy
hub / github.com/tinode/chat / TestTopicUpdate

Function TestTopicUpdate

server/db/postgres/tests/postgres_test.go:846–862  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

844}
845
846func TestTopicUpdate(t *testing.T) {
847 update := map[string]any{
848 "UpdatedAt": testData.Now.Add(55 * time.Minute),
849 }
850 err := adp.TopicUpdate(testData.Topics[0].Id, update)
851 if err != nil {
852 t.Fatal(err)
853 }
854 var got time.Time
855 err = db.QueryRow(ctx, "SELECT updatedat FROM topics WHERE name=$1", testData.Topics[0].Id).Scan(&got)
856 if err != nil {
857 t.Fatal(err)
858 }
859 if got != update["UpdatedAt"] {
860 t.Error(mismatchErrorString("UpdatedAt", got, update["UpdatedAt"]))
861 }
862}
863
864func TestTopicUpdateSubCnt(t *testing.T) {
865 // Test PostgreSQL specific method

Callers

nothing calls this directly

Calls 5

ErrorMethod · 0.80
mismatchErrorStringFunction · 0.70
TopicUpdateMethod · 0.65
AddMethod · 0.45
ScanMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…