You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
28 lines
578 B
28 lines
578 B
package dao |
|
|
|
import ( |
|
"context" |
|
"testing" |
|
|
|
"go-common/app/job/main/dm/conf" |
|
) |
|
|
|
func TestDuration(t *testing.T) { |
|
var ( |
|
err error |
|
res int64 |
|
cid = int64(1) |
|
duration = int64(100) |
|
c = context.TODO() |
|
) |
|
d := New(conf.Conf) |
|
if err = d.SetDurationCache(c, cid, duration); err != nil { |
|
t.Errorf("d.SetDurationCache(%d,%d) error(%v)", cid, duration, err) |
|
} |
|
if res, err = d.DurationCache(c, cid); err != nil { |
|
t.Errorf("d.DurationCache(%d) error(%v)", cid, err) |
|
} |
|
if res != duration { |
|
t.Errorf("not expect value %d,%d", duration, res) |
|
} |
|
}
|
|
|