Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/MHSanaei/3x-ui.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpwnnex <pwnnex@proton.me>2026-04-22 19:02:05 +0300
committerGitHub <noreply@github.com>2026-04-22 19:02:05 +0300
commit530c1597b87b95b1f22c6c25ab9a6041849b5a42 (patch)
tree475c624ceb876648c494efd5672320ece6beac39 /database/model/model_test.go
parentc8e16d8c417680b6169bbe63d576c79b884961b8 (diff)
parent17f67ef3a51537cbb32b2fcd3884c26434f4ee62 (diff)
Merge pull request #4086 from pwnnex/fix/hysteria2-protocol-aliases
hysteria: accept "hysteria2" as a protocol string (#4081)
Diffstat (limited to 'database/model/model_test.go')
-rw-r--r--database/model/model_test.go22
1 files changed, 22 insertions, 0 deletions
diff --git a/database/model/model_test.go b/database/model/model_test.go
new file mode 100644
index 00000000..d98c5157
--- /dev/null
+++ b/database/model/model_test.go
@@ -0,0 +1,22 @@
+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)
+ }
+ }
+}