52 lines
940 B
Go
52 lines
940 B
Go
package main
|
||
|
||
import (
|
||
"backend/controller"
|
||
"backend/util"
|
||
"fmt"
|
||
"testing"
|
||
)
|
||
|
||
func TestXxx1(t *testing.T) {
|
||
// controller.FeishuSendInfo(nil)
|
||
str := `
|
||
## 日期:2021-09-01
|
||
## 代办事项
|
||
- [ ] 任务1
|
||
- [ ] 任务2
|
||
- [ ] 任务3
|
||
`
|
||
str = util.ToTmplStr(str)
|
||
fmt.Println(str)
|
||
}
|
||
func TestXxx(t *testing.T) {
|
||
controller.FeishuSendInfo2(nil)
|
||
}
|
||
|
||
func TestFeishu(t *testing.T) {
|
||
data := struct {
|
||
Title string
|
||
Subtitle string
|
||
Elements string
|
||
}{
|
||
Title: "模拟测试",
|
||
Subtitle: "模拟测试副标题",
|
||
Elements: "",
|
||
}
|
||
s := util.ParseTmpl("./template/card.tmpl", data)
|
||
fmt.Println(s)
|
||
}
|
||
|
||
func TestEncrypt(t *testing.T) {
|
||
str := "Z4rf7eZZe500dxa"
|
||
enc, _ := util.Encrypt(str)
|
||
fmt.Println(enc)
|
||
}
|
||
|
||
func TestDecrypt(t *testing.T) {
|
||
str := "-pUf9tft9GOPjV1z855Jf2DpB5NUpGEc_"
|
||
enc, _ := util.Encrypt(str)
|
||
dec, _ := util.Decrypt("-pUf9tft9GOPjV1z855Jf2DpB5NUpGEc_")
|
||
fmt.Printf("enc:%s\ndec:%s\n", enc, dec)
|
||
}
|