mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-04-26 01:15:57 +00:00
23 lines
412 B
Go
23 lines
412 B
Go
|
|
package model
|
||
|
|
|
||
|
|
import "testing"
|
||
|
|
|
||
|
|
func TestIsHysteria(t *testing.T) {
|
||
|
|
cases := []struct {
|
||
|
|
in Protocol
|
||
|
|
want bool
|
||
|
|
}{
|
||
|
|
{Hysteria, true},
|
||
|
|
{Hysteria2, true},
|
||
|
|
{VLESS, false},
|
||
|
|
{Shadowsocks, false},
|
||
|
|
{Protocol(""), false},
|
||
|
|
{Protocol("hysteria3"), false},
|
||
|
|
}
|
||
|
|
for _, c := range cases {
|
||
|
|
if got := IsHysteria(c.in); got != c.want {
|
||
|
|
t.Errorf("IsHysteria(%q) = %v, want %v", c.in, got, c.want)
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|