-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathutil_test.go
More file actions
40 lines (36 loc) · 779 Bytes
/
Copy pathutil_test.go
File metadata and controls
40 lines (36 loc) · 779 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
package gorose
import (
"testing"
"time"
)
func TestStructToMap(t *testing.T) {
user := Users{Uid: 1, Name: "gorose"}
data := StructToMap(user)
t.Log(data)
}
func TestIf(t *testing.T) {
closer := func() {
time.Sleep(1 * time.Second)
}
withRunTimeContext(closer, func(td time.Duration) {
t.Log("用时:", td, td.Seconds() > 1)
})
}
//func TestStructToMap2(t *testing.T) {
// var u Users
// //res := structForScan(&u)
// res := structForScan(reflect.ValueOf(&u).Interface())
// for _, item := range res {
// err := varBindValue.BindVal(item, 1234)
// if err != nil {
// t.Error(err.Error())
// }
// }
// t.Log(res, u)
//}
func Test_getRandomInt(t *testing.T) {
t.Log(getRandomInt(2))
t.Log(getRandomInt(3))
t.Log(getRandomInt(2))
t.Log(getRandomInt(3))
}