2020-12-28 10:23:54 +08:00
|
|
|
package test
|
|
|
|
|
|
|
|
import (
|
|
|
|
"fmt"
|
2021-03-14 19:13:09 +08:00
|
|
|
"github.com/Xhofe/alist/utils"
|
2021-03-07 21:02:56 +08:00
|
|
|
"path/filepath"
|
2020-12-28 10:23:54 +08:00
|
|
|
"strings"
|
|
|
|
"testing"
|
|
|
|
)
|
|
|
|
|
|
|
|
func TestSplit(t *testing.T) {
|
2021-03-05 21:25:44 +08:00
|
|
|
drive_id := "/123/456"
|
|
|
|
strs := strings.Split(drive_id, "/")
|
2020-12-28 10:23:54 +08:00
|
|
|
fmt.Println(strs)
|
2021-03-05 21:25:44 +08:00
|
|
|
}
|
2021-03-06 23:19:16 +08:00
|
|
|
|
|
|
|
func TestPassword(t *testing.T) {
|
2021-03-16 23:15:37 +08:00
|
|
|
fullName := "hello.password-xhf"
|
|
|
|
index := strings.Index(fullName, ".password-")
|
|
|
|
name := fullName[:index]
|
|
|
|
password := fullName[index+10:]
|
|
|
|
fmt.Printf("name:%s, password:%s\n", name, password)
|
2021-03-07 21:02:56 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
func TestDir(t *testing.T) {
|
2021-03-16 23:15:37 +08:00
|
|
|
dir, file := filepath.Split("root")
|
|
|
|
fmt.Printf("dir:%s\nfile:%s\n", dir, file)
|
2021-03-14 19:13:09 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
func TestMD5(t *testing.T) {
|
|
|
|
fmt.Printf("%s\n", utils.Get16MD5Encode("123456"))
|
2021-03-16 23:15:37 +08:00
|
|
|
}
|