mirror of
https://github.com/MengMengCode/VoCat.git
synced 2026-08-13 03:13:43 +08:00
- Implemented `telegramAPIURL` and `validateTelegramAPIURL` functions for constructing and validating Telegram API URLs. - Added semantic versioning utilities in `version.go` to compare versions and validate semantic version formats. - Created tests for version comparison logic in `version_test.go`. - Introduced IMS call handling in `call_runtime.go`, including methods for dialing, answering, and hanging up calls. - Added tests for incoming call handling and validation in `call_runtime_test.go`. - Developed a new `PluginsCard` component for managing plugins via URL or file upload in the web interface. - Implemented plugin management functions in `extensions.ts` and created an `ExtensionPage` for displaying plugin contributions.
25 lines
635 B
Go
25 lines
635 B
Go
package update
|
|
|
|
import (
|
|
"reflect"
|
|
"testing"
|
|
)
|
|
|
|
func TestAssetNamesFor(t *testing.T) {
|
|
tests := []struct {
|
|
goos string
|
|
goarch string
|
|
want []string
|
|
}{
|
|
{"linux", "amd64", []string{"vocat-linux-amd64"}},
|
|
{"linux", "386", []string{"vocat-linux-386"}},
|
|
{"linux", "arm64", []string{"vocat-linux-arm64", "vocat-linux-aarch64"}},
|
|
{"linux", "arm", []string{"vocat-linux-armv7", "vocat-linux-arm"}},
|
|
}
|
|
for _, item := range tests {
|
|
if got := assetNamesFor(item.goos, item.goarch); !reflect.DeepEqual(got, item.want) {
|
|
t.Errorf("assetNamesFor(%q, %q) = %#v, want %#v", item.goos, item.goarch, got, item.want)
|
|
}
|
|
}
|
|
}
|