type_test.go 316 B

12345678910111213141516
  1. package tinymq
  2. import "testing"
  3. func TestParseUrl(t *testing.T) {
  4. url := "ws2://xor:s^7mv7L!Mrn8Y!vn@127.0.0.1:141/wsv2?proxy=1&priority=90"
  5. hostInfo, err := ParseUrl(url)
  6. if err != nil {
  7. t.Error(err)
  8. return
  9. }
  10. result := hostInfo.Url()
  11. if result != url {
  12. t.Errorf("want: %s, get: %s", url, result)
  13. }
  14. }