27 lines
447 B
Go
27 lines
447 B
Go
package utils_test
|
|
|
|
import (
|
|
"fmt"
|
|
"go_dreamfactory/utils"
|
|
"testing"
|
|
"time"
|
|
)
|
|
|
|
func TestIsToday(t *testing.T) {
|
|
// fmt.Println(utils.IsToday(0))
|
|
tt := time.Unix(1658139742, 0)
|
|
fmt.Println(time.Now().Before(tt))
|
|
}
|
|
|
|
func TestSubTime(t *testing.T) {
|
|
fmt.Println(utils.IsAfterWeek(1657172915))
|
|
}
|
|
|
|
func TestRandom(t *testing.T) {
|
|
fmt.Println(utils.GenValidateCode(6))
|
|
}
|
|
|
|
func TestNumber(t *testing.T) {
|
|
fmt.Println(utils.Numbers(5, 10, 5))
|
|
}
|