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.
46 lines
716 B
46 lines
716 B
package service
|
|
|
|
import (
|
|
"fmt"
|
|
"log"
|
|
"testing"
|
|
"time"
|
|
)
|
|
|
|
func TestFindFeedInHB(t *testing.T) {
|
|
Init()
|
|
|
|
res, err := FindFeedInHB("1627500000", fmt.Sprint(time.Now().Unix()))
|
|
if err != nil {
|
|
log.Panicln(err)
|
|
}
|
|
|
|
log.Println(len(res))
|
|
}
|
|
|
|
func TestSearchFeedEarlierInHB(t *testing.T) {
|
|
Init()
|
|
|
|
curr := time.Now().Unix()
|
|
|
|
res, err := SearchFeedEarlierInHB(curr, curr-86400*7)
|
|
if err != nil {
|
|
log.Panicln(err)
|
|
}
|
|
|
|
log.Println(len(res))
|
|
}
|
|
|
|
func TestSearchFeedLaterInHB(t *testing.T) {
|
|
Init()
|
|
|
|
curr := time.Now().Unix()
|
|
|
|
res, newMarkedTime, err := SearchFeedLaterInHB(fmt.Sprint(curr-86400), fmt.Sprint(curr))
|
|
if err != nil {
|
|
log.Panicln(err)
|
|
}
|
|
|
|
log.Println(len(res))
|
|
log.Println(newMarkedTime)
|
|
}
|
|
|