18 lines
348 B
Go
18 lines
348 B
Go
package subscription
|
|
|
|
import "testing"
|
|
|
|
func TestParseBodyPlain(t *testing.T) {
|
|
body := `# comment
|
|
hysteria2://pass@ex.com:443/?sni=ex.com&obfs=salamander&obfs-password=x#EU
|
|
naive+https://u:p@n.example.com#naive1
|
|
`
|
|
items, err := ParseBody(body)
|
|
if err != nil {
|
|
t.Fatal(err)
|
|
}
|
|
if len(items) != 2 {
|
|
t.Fatalf("got %d items", len(items))
|
|
}
|
|
}
|