MCPcopy Create free account
hub / github.com/daodst/chat / TestCleanExpireHistoryMsgs

Function TestCleanExpireHistoryMsgs

new_feature/clean_func_test.go:8–30  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

6)
7
8func TestCleanExpireHistoryMsgs(t *testing.T) {
9 err := new_db.InitDb("postgresql://postgres:postgres@127.0.0.1:5432/chat?sslmode=disable")
10 if err != nil {
11 t.Error("err init db")
12 }
13 type args struct {
14 interval int64
15 }
16 tests := []struct {
17 name string
18 args args
19 wantErr bool
20 }{
21 {name: "1", args: args{1}},
22 }
23 for _, tt := range tests {
24 t.Run(tt.name, func(t *testing.T) {
25 if err := CleanExpireHistoryMsgs(tt.args.interval); (err != nil) != tt.wantErr {
26 t.Errorf("CleanExpireHistoryMsgs() error = %v, wantErr %v", err, tt.wantErr)
27 }
28 })
29 }
30}

Callers

nothing calls this directly

Calls 3

CleanExpireHistoryMsgsFunction · 0.85
RunMethod · 0.80
ErrorMethod · 0.45

Tested by

no test coverage detected