2026-07-12 00:47:20 +08:00

22 lines
544 B
Go
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

package grpc
import (
"testing"
userv1 "hyapp.local/api/proto/user/v1"
)
func TestAuthMetaMapsClientVersionSnapshot(t *testing.T) {
meta := authMeta(&userv1.RequestMeta{
RequestId: "req-version",
AppCode: "lalu",
AppVersion: "2.4.0",
BuildNumber: "24001",
})
// 密码登录没有独立的版本字段,只能依赖 RequestMeta这里防止 transport 后续新增字段时漏掉审计映射。
if meta.AppVersion != "2.4.0" || meta.BuildNumber != "24001" {
t.Fatalf("client version meta mismatch: %+v", meta)
}
}