mirror of
https://github.com/bestnite/sub2clash.git
synced 2025-06-17 12:43:18 +08:00
fix: hy2 解析缺少 name 字段
This commit is contained in:
22
test/parser_test.go
Normal file
22
test/parser_test.go
Normal file
@ -0,0 +1,22 @@
|
||||
package test
|
||||
|
||||
import (
|
||||
"sub2clash/parser"
|
||||
"testing"
|
||||
|
||||
"gopkg.in/yaml.v3"
|
||||
)
|
||||
|
||||
func TestHy2Parser(t *testing.T) {
|
||||
res, err := parser.ParseHysteria2("hysteria2://letmein@example.com/?insecure=1&obfs=salamander&obfs-password=gawrgura&pinSHA256=deadbeef&sni=real.example.com")
|
||||
if err != nil {
|
||||
t.Log(err.Error())
|
||||
t.Fail()
|
||||
}
|
||||
bytes, err := yaml.Marshal(res)
|
||||
if err != nil {
|
||||
t.Log(err.Error())
|
||||
t.Fail()
|
||||
}
|
||||
t.Log(string(bytes))
|
||||
}
|
Reference in New Issue
Block a user