(t *testing.T)
| 6 | ) |
| 7 | |
| 8 | func 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 | } |
nothing calls this directly
no test coverage detected