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

Function TestTopicUpdate

server/db/rethinkdb/tests/rethink_test.go:858–880  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

856}
857
858func TestTopicUpdate(t *testing.T) {
859 update := map[string]any{
860 "UpdatedAt": testData.Now.Add(55 * time.Minute),
861 }
862 err := adp.TopicUpdate(testData.Topics[0].Id, update)
863 if err != nil {
864 t.Fatal(err)
865 }
866
867 cursor, err := rdb.Table("topics").Get(testData.Topics[0].Id).Field("UpdatedAt").Run(conn)
868 if err != nil {
869 t.Fatal(err)
870 }
871 defer cursor.Close()
872
873 var got time.Time
874 if err = cursor.One(&got); err != nil {
875 t.Fatal(err)
876 }
877 if !got.Equal(update["UpdatedAt"].(time.Time)) {
878 t.Error(mismatchErrorString("UpdatedAt", got, update["UpdatedAt"]))
879 }
880}
881
882func TestTopicUpdateSubCnt(t *testing.T) {
883 // Test RethinkDB specific method

Callers

nothing calls this directly

Calls 6

ErrorMethod · 0.80
mismatchErrorStringFunction · 0.70
TopicUpdateMethod · 0.65
GetMethod · 0.65
CloseMethod · 0.65
AddMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…