Initial commit

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
2026-09-15 13:57:10 +08:00
co-authored by Claude Opus 5
commit 8679200f41
1897 changed files with 257900 additions and 0 deletions
+45
View File
@@ -0,0 +1,45 @@
package mediaService
import "testing"
func TestShouldUpdateH265URL(t *testing.T) {
tests := []struct {
name string
current string
incoming string
want bool
}{
{
name: "empty incoming does not erase existing URL",
current: "https://cdn.example.com/existing.m3u8",
incoming: "",
want: false,
},
{
name: "whitespace incoming does not erase existing URL",
current: "https://cdn.example.com/existing.m3u8",
incoming: " ",
want: false,
},
{
name: "same URL does not update",
current: "https://cdn.example.com/hevc.m3u8",
incoming: " https://cdn.example.com/hevc.m3u8 ",
want: false,
},
{
name: "new non-empty URL updates",
current: "",
incoming: "https://cdn.example.com/hevc.m3u8",
want: true,
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
if got := shouldUpdateH265URL(tt.current, tt.incoming); got != tt.want {
t.Fatalf("shouldUpdateH265URL() = %v, want %v", got, tt.want)
}
})
}
}