docs(comments): 注释中文化 · plugins/channels/weixin_ilink(20 文件,纯替换)
- 只翻注释/文档字符串:剥掉行尾注释后,每条「-」都有逐字节相同的「+」对应行(8 组,代码零改动) - 保留协议/线上标识符原文:errcode、bot_token、context_token、getupdates、binded_redirect、PKCS#7、ECB 等 - 术语对齐既有译法:owner→主人、peer→对端、long poll→长轮询、backoff→退避、sentinel error→哨兵错误 - 已知既有欠债(未顺手修):login_reuse_test.go 在 HEAD 上就未 gofmt 干净;login_test.go 的 TestStartLogin_ScanStatusTransition 91 行 >80(HEAD 同为 91 行)
This commit is contained in:
1 parent
09fba77f87
commit
95f97f5df3
20 files changed
+488
-590
No files matched your search
@@ -50,7 +50,7 @@ func TestAdapter_Config_ReturnsSnapshot(t *testing.T) {
|
||||
if cfg["base_url"] != "https://ilinkai.weixin.qq.com" {
|
||||
t.Fatalf("Config()[base_url] = %v", cfg["base_url"])
|
||||
}
|
||||
// Round-tripping through DecodeConfig must preserve the typed config.
|
||||
// 经 DecodeConfig 往返必须保留类型化配置。
|
||||
var back Config
|
||||
if err := adapter.DecodeConfig(cfg, &back); err != nil {
|
||||
t.Fatalf("DecodeConfig: %v", err)
|
||||
@@ -75,7 +75,7 @@ func TestAdapter_Connect_WithToken_IsIdempotent(t *testing.T) {
|
||||
if !ad.IsConnected() {
|
||||
t.Fatal("IsConnected() = false after Connect")
|
||||
}
|
||||
// Second call is a no-op success.
|
||||
// 第二次调用是无副作用的成功。
|
||||
if err := ad.Connect(context.Background()); err != nil {
|
||||
t.Fatalf("second Connect: %v", err)
|
||||
}
|
||||
@@ -149,7 +149,7 @@ func TestAdapter_SetMessageHandler_And_RecordInbound(t *testing.T) {
|
||||
t.Fatal("handler called before any message")
|
||||
}
|
||||
|
||||
// recordInbound must refresh the per-peer token and last-message time.
|
||||
// recordInbound 必须刷新按对端的 token 与最后消息时间。
|
||||
ad.recordInbound("tok-abc", adapter.UnifiedMessage{
|
||||
SenderID: "user-1",
|
||||
Timestamp: ad.clock(),
|
||||
@@ -162,8 +162,8 @@ func TestAdapter_SetMessageHandler_And_RecordInbound(t *testing.T) {
|
||||
func TestBuildClientVersion(t *testing.T) {
|
||||
t.Parallel()
|
||||
cases := map[string]string{
|
||||
"2.4.8": "132104", // official @tencent-weixin/openclaw-weixin 2.4.8
|
||||
"1.0.11": "65547", // official comment example 0x0001000B
|
||||
"2.4.8": "132104", // 官方 @tencent-weixin/openclaw-weixin 2.4.8
|
||||
"1.0.11": "65547", // 官方注释示例 0x0001000B
|
||||
"1.2.3": "66051",
|
||||
"0.0.0": "0",
|
||||
"bad": "0",
|
||||
|
||||
Reference in new issue
Block a user