暂时删除测试文件

master
李光春 2 years ago
parent 51133d42ab
commit 155a58819c

@ -1,8 +0,0 @@
package goarray
import "testing"
func TestName(t *testing.T) {
ss := []string{"c2:37:7d:2b:78:c3", "c2:37:7d:2b:78:c4", "14:98:77:5a:58:66", "c2:37:7d:2b:78:a3", "c2:37:7d:2b:78:a4", "36:ce:4f:d2:84:00", "36:ce:4f:d2:84:04", "36:98:77:50:03:1b", "14:98:77:50:03:1b", "36:ce:4f:d2:84:00", "e2:ed:05:15:9c:2a", "e2:ed:05:15:9c:2a"}
t.Log(TurnString(ss))
}

@ -1,13 +0,0 @@
package gobase64
import (
"testing"
)
func TestEncode(t *testing.T) {
t.Log(Encode("广东茂名"))
}
func TestDecode(t *testing.T) {
t.Log(Decode(Encode("广东茂名")))
}

@ -1,9 +0,0 @@
package godecimal
import (
"testing"
)
func TestName(t *testing.T) {
t.Log(Decimal(2.3333))
}

@ -1,13 +0,0 @@
package gohttp
import (
"testing"
)
func TestName(t *testing.T) {
get, err := Get("https://api.dtapp.net/", nil)
t.Logf("%+v\n", get)
if err != nil {
return
}
}

@ -1,13 +0,0 @@
package goint
import (
"testing"
)
func TestToString(t *testing.T) {
t.Log(ToString(9898))
}
func TestToFloat64(t *testing.T) {
t.Log(ToFloat64(9898))
}

@ -1,33 +0,0 @@
package golog
import (
"log"
"testing"
)
var app = App{
LogPath: "./",
LogName: "all.log",
LogLevel: "debug",
MaxSize: 2,
MaxBackups: 30,
MaxAge: 0,
Compress: false,
JsonFormat: false,
ShowLine: true,
LogInConsole: true,
}
func TestLog(t *testing.T) {
log.Println(app.Logger)
app.InitLogger()
app.Logger.Debug("debug 日志")
app.Logger.Sugar().Debug("debug 日志")
app.Logger.Info("info 日志")
app.Logger.Sugar().Info("info 日志")
app.Logger.Warn("warning 日志")
app.Logger.Sugar().Warn("warning 日志")
app.Logger.Error("error 日志")
app.Logger.Sugar().Error("error 日志")
log.Println(app.Logger)
}

@ -1,11 +0,0 @@
package gomd5
import (
"testing"
)
func TestMd5(t *testing.T) {
t.Logf(GetMD5Encode("测试"))
t.Logf(ToUpper(GetMD5Encode("测试")))
t.Logf(ToUpper("测试"))
}

@ -1,41 +0,0 @@
package gophp
import (
"encoding/json"
"fmt"
"testing"
)
func TestPhp(t *testing.T) {
fmt.Println(Unserialize([]byte(`a:1:{s:4:"test";i:34343;}`)))
serialize, _ := Serialize(map[string]interface{}{
"test": 34343,
})
fmt.Println(string(serialize))
}
type student struct {
Amount string `json:"amount"`
CreateTime string `json:"create_time"`
UpdateTime string `json:"update_time"`
UserID string `json:"user_id"`
}
func TestUnserialize(t *testing.T) {
unserialize, _ := Unserialize([]byte(`a:2:{i:0;a:4:{s:7:"user_id";s:5:"10118";s:6:"amount";s:5:"69.00";s:11:"create_time";s:19:"2021-01-04 16:29:03";s:11:"update_time";s:19:"2021-06-15 16:02:46";}i:1;a:4:{s:7:"user_id";s:5:"10088";s:6:"amount";s:5:"10.00";s:11:"create_time";s:19:"2021-01-04 15:46:10";s:11:"update_time";s:19:"2021-06-15 15:50:06";}}`))
fmt.Printf("%s\n", unserialize)
arr, _ := json.Marshal(unserialize)
fmt.Printf("arr%s\n", arr)
var stu []student
_ = json.Unmarshal(arr, &stu)
fmt.Printf("stu%v\n", stu)
}
func TestUnserialize2(t *testing.T) {
unserialize, err := Unserialize([]byte(`a:3:{s:4:"self";a:5:{s:2:"id";i:32;s:7:"user_id";i:10118;s:16:"merchant_user_id";i:10150;s:5:"level";i:3;s:5:"split";d:2.825;}s:5:"split";a:2:{i:0;a:7:{s:2:"id";i:12;s:7:"user_id";i:10000;s:13:"agent_user_id";i:10088;s:16:"user_golden_bean";d:5;s:5:"level";i:1;s:11:"calculation";d:0.010000000000000002;s:5:"split";d:0.57;}i:1;a:7:{s:2:"id";i:19;s:7:"user_id";i:10088;s:13:"agent_user_id";i:10118;s:16:"user_golden_bean";d:4;s:5:"level";i:2;s:11:"calculation";d:0.04;s:5:"split";d:2.26;}}s:11:"golden_bean";a:6:{s:4:"fans";d:56.5;s:12:"fan_referrer";d:16.95;s:8:"merchant";d:4.5200000000000005;s:5:"agent";d:2.825;s:5:"count";d:80.795;s:2:"bf";a:9:{s:2:"id";i:2;s:7:"user_id";i:10088;s:4:"fans";d:50;s:12:"fan_referrer";d:30;s:8:"merchant";d:8;s:6:"system";d:0;s:5:"agent";d:5;s:11:"create_time";s:19:"2020-11-20 14:47:21";s:11:"update_time";s:19:"2020-11-20 14:47:21";}}}`))
fmt.Printf("%+v\n", unserialize)
if err != nil {
fmt.Printf("err%v\n", err)
return
}
}

@ -1,7 +0,0 @@
package gopreg
import "testing"
func TestName(t *testing.T) {
}

@ -1,22 +0,0 @@
package gorandom
import (
"fmt"
"testing"
)
func TestAlphanumeric(t *testing.T) {
fmt.Println(Alphanumeric(10))
}
func TestAlphabetic(t *testing.T) {
fmt.Println(Alphabetic(10))
}
func TestNumeric(t *testing.T) {
fmt.Println(Numeric(10))
}
func TestAscii(t *testing.T) {
fmt.Println(Ascii(10))
}

@ -1,9 +0,0 @@
package gorequest
import (
"testing"
)
func TestExternalIp(t *testing.T) {
t.Log(ExternalIp())
}

@ -1,9 +0,0 @@
package gossh
import (
"testing"
)
func TestClient(t *testing.T) {
//Tunnel("root", "", ":22", ":3306", "localhost:13306")
}

@ -1,39 +0,0 @@
package gostring
import (
"fmt"
"strings"
"testing"
)
func TestName(t *testing.T) {
str := "iPhone 11 Pro Max<iPhone12,5>"
fmt.Printf("%d\n", strings.LastIndex(str, "<"))
fmt.Printf("%d\n", strings.LastIndex(str, "("))
fmt.Printf("%d\n", strings.LastIndex("iPad (6th generation, WiFi)<iPad7,5>", "<"))
fmt.Printf("%d\n", strings.LastIndex("iPad (6th generation, WiFi)<iPad7,5>", "("))
s := str[0:17]
fmt.Printf("%s\n", s)
str = "iPad (6th generation, WiFi)<iPad7,5>"
s = str[0:5]
fmt.Printf("%s\n", s)
fmt.Printf(strings.TrimSpace(s))
}
func TestToInt64(t *testing.T) {
t.Log(ToInt64("120"))
t.Log(ToInt64("120.9"))
t.Log(strings.Contains("120", ","))
t.Log(strings.Contains("120,1", ","))
}
func TestString(t *testing.T) {
str := "wx6566ef69e8738ad9"
fmt.Println(strings.Contains(str, "wx"))
myString := "www.dtapp.net"
if strings.HasPrefix(myString, "www") {
fmt.Println("Hello to you too")
} else {
fmt.Println("Goodbye")
}
}

@ -1,124 +0,0 @@
package gotime
import (
"testing"
)
func TestTime(t *testing.T) {
t.Log("今天此刻:", Current().Now())
t.Log("今天此刻格式化:", Current().Format())
t.Log("今天此刻日期:", Current().ToDateFormat())
t.Log("今天此刻时间:", Current().ToTimeFormat())
t.Log("今天此刻时间戳:", Current().Timestamp())
t.Log("今天此刻时间戳:", Current().TimestampWithSecond())
t.Log("今天毫秒级时间戳:", Current().TimestampWithMillisecond())
t.Log("今天微秒级时间戳:", Current().TimestampWithMicrosecond())
t.Log("今天纳秒级时间戳:", Current().TimestampWithNanosecond())
t.Log("昨天此刻:", Yesterday().Now())
t.Log("昨天此刻格式化:", Yesterday().Format())
t.Log("昨天此刻日期:", Yesterday().ToDateFormat())
t.Log("昨天此刻时间:", Yesterday().ToTimeFormat())
t.Log("昨天此刻时间戳:", Yesterday().Timestamp())
t.Log("昨天此刻时间戳:", Yesterday().TimestampWithSecond())
t.Log("昨天毫秒级时间戳:", Yesterday().TimestampWithMillisecond())
t.Log("昨天微秒级时间戳:", Yesterday().TimestampWithMicrosecond())
t.Log("昨天纳秒级时间戳:", Yesterday().TimestampWithNanosecond())
t.Log("明天此刻:", Tomorrow().Now())
t.Log("明天此刻格式化:", Tomorrow().Format())
t.Log("明天此刻日期:", Tomorrow().ToDateFormat())
t.Log("明天此刻时间:", Tomorrow().ToTimeFormat())
t.Log("明天此刻时间戳:", Tomorrow().Timestamp())
t.Log("明天此刻时间戳:", Tomorrow().TimestampWithSecond())
t.Log("明天毫秒级时间戳:", Tomorrow().TimestampWithMillisecond())
t.Log("明天微秒级时间戳:", Tomorrow().TimestampWithMicrosecond())
t.Log("明天纳秒级时间戳:", Tomorrow().TimestampWithNanosecond())
t.Log("本世纪开始时间:", Current().StartOfCentury().Format())
t.Log("本世纪结束时间:", Current().EndOfCentury().Format())
t.Log("本年代开始时间:", Current().StartOfDecade().Format())
t.Log("本年代结束时间:", Current().EndOfDecade().Format())
t.Log("本年开始时间:", Current().StartOfYear().Format())
t.Log("本年结束时间:", Current().EndOfYear().Format())
t.Log("本季度开始时间:", Current().StartOfQuarter().Format())
t.Log("本季度结束时间:", Current().EndOfQuarter().Format())
t.Log("本月开始时间:", Current().StartOfMonth().Format())
t.Log("本月结束时间:", Current().EndOfMonth().Format())
//t.Log("7100秒前的时间", Current().BeforeSeconds(7100).Format())
//t.Log("2小时前的时间", Current().BeforeHour(2).Format())
//t.Log("7100秒后的时间", Current().AfterSeconds(7100).Format())
//t.Log("2小时后的时间", Current().AfterHour(2).Format())
}
func TestStartOfDay(t *testing.T) {
t.Log(Current().Format())
t.Log(Current().StartOfDay().Format())
t.Log(Current().EndOfDay().Format())
t.Log(Current().Timestamp())
t.Log(Current().StartOfDay().Timestamp())
t.Log(Current().EndOfDay().Timestamp())
t.Log(Current().BeforeDay(1).Format())
t.Log(Current().BeforeDay(1).StartOfDay().Format())
t.Log(Current().BeforeDay(1).EndOfDay().Format())
t.Log(Current().AfterDay(1).Format())
t.Log(Current().AfterDay(1).StartOfDay().Format())
t.Log(Current().AfterDay(1).EndOfDay().Format())
}
func TestDiff(t *testing.T) {
t.Log(Current().DiffInHourWithAbs(SetCurrentParse("2021-11-26 14:50:00").Time))
t.Log(Current().DiffInHour(SetCurrentParse("2021-11-26 14:50:00").Time))
t.Log(Current().DiffInMinutesWithAbs(SetCurrentParse("2021-11-26 14:50:00").Time))
t.Log(Current().DiffInMinutes(SetCurrentParse("2021-11-26 14:50:00").Time))
t.Log(SetCurrentParse("2022-03-01T10:03:39+08:00").Format())
t.Log(SetCurrentParse("2022-03-04T11:12:47+08:00").Format())
}
func TestUnix(t *testing.T) {
t.Log(SetCurrentUnix(1640067240).Format())
t.Log(Current().BeforeDay(3 - 2).StartOfDay().Format())
t.Log(Current().BeforeDay(3 - 1).EndOfDay().Format())
}
func Test2(t *testing.T) {
t.Log(Current().BeforeDay(1 + 1).Format())
t.Log(Current().BeforeDay(1).Format())
t.Log(Current().BeforeHour(24).Format())
t.Log(Current().Format())
}
func TestTaoBao(t *testing.T) {
i := 1
for {
if i > 3 {
break
}
t.Log(i)
t.Log(i * 24)
t.Log((i * 24) - 24)
t.Log(Current().BeforeHour(i * 24).Format())
t.Log(Current().BeforeHour((i * 24) - 24).Format())
i++
}
}
func TestMT(t *testing.T) {
day := 1
t.Log(day)
t.Log(Current().BeforeHour(24 * day).Format())
t.Log(Current().BeforeHour(24 * (day - 1)).Format())
day = 2
t.Log(day)
t.Log(Current().BeforeHour(24 * day).Format())
t.Log(Current().BeforeHour(24 * (day - 1)).Format())
day = 3
t.Log(day)
t.Log(Current().BeforeHour(24 * day).Format())
t.Log(Current().BeforeHour(24 * (day - 1)).Format())
}

@ -1,68 +0,0 @@
package gourl
import (
"testing"
"time"
)
func TestLenCode(t *testing.T) {
type args struct {
s string
}
tests := []struct {
name string
args args
want string
}{{
name: "https://www.dtapp.net",
}, {
name: "https://www.dtapp.net",
}, {
name: "https://www.dtapp.net",
}}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
start := time.Now()
t.Log(LenCode(tt.name))
elapsed := time.Since(start)
t.Log("run time", elapsed)
})
}
}
func BenchmarkLenCode(b *testing.B) {
for n := 0; n < b.N; n++ {
LenCode("https://www.dtapp.net")
}
}
func TestDeCode(t *testing.T) {
type args struct {
s string
}
tests := []struct {
name string
args args
want string
}{{
name: "https%3A%2F%2Fwww.dtapp.net",
}, {
name: "https%3A%2F%2Fwww.dtapp.net",
}, {
name: "https%3A%2F%2Fwww.dtapp.net",
}}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
start := time.Now()
t.Log(DeCode(tt.name))
elapsed := time.Since(start)
t.Log("run time", elapsed)
})
}
}
func BenchmarkDeCode(b *testing.B) {
for n := 0; n < b.N; n++ {
DeCode("https%3A%2F%2Fwww.dtapp.net")
}
}

@ -1,23 +0,0 @@
package gouuid
import (
"testing"
)
func TestGetUuId(t *testing.T) {
tests := []struct {
name string
want string
}{{}, {}, {}}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
t.Log(GetUuId())
})
}
}
func BenchmarkGetUuId(b *testing.B) {
for n := 0; n < b.N; n++ {
GetUuId()
}
}
Loading…
Cancel
Save