mirror of
https://github.com/nitezs/sub2clash.git
synced 2024-12-23 22:04:41 -05:00
23 lines
435 B
Go
23 lines
435 B
Go
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))
|
|
}
|