Merge remote-tracking branch 'origin/main' into codex/pr620-fix
This commit is contained in:
@@ -47,6 +47,25 @@ func TestRootHelpHidesCompatibilityOnlyCommands(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestCalendarEventCreateHelpKeepsRoomsStringMetavar(t *testing.T) {
|
||||
cmd := NewRootCommand()
|
||||
var out bytes.Buffer
|
||||
cmd.SetOut(&out)
|
||||
cmd.SetErr(&out)
|
||||
cmd.SetArgs([]string{"calendar", "event", "create", "--help"})
|
||||
if err := cmd.Execute(); err != nil {
|
||||
t.Fatalf("calendar event create --help: %v\n%s", err, out.String())
|
||||
}
|
||||
|
||||
help := out.String()
|
||||
if !strings.Contains(help, "--rooms string") {
|
||||
t.Fatalf("calendar event create help missing string metavar for --rooms:\n%s", help)
|
||||
}
|
||||
if strings.Contains(help, "--rooms room search") {
|
||||
t.Fatalf("calendar event create help treated description text as --rooms metavar:\n%s", help)
|
||||
}
|
||||
}
|
||||
|
||||
func TestRootKeepsMainBranchChatCompatibilityCommands(t *testing.T) {
|
||||
root := NewRootCommand()
|
||||
listDirect := mustFindCommand(t, root, "chat", "message", "list-direct")
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"version": 1,
|
||||
"source_hash": "sha256:ad2173126ac607dc824408d96906d1d183464e052f2d367158cc067bfbefcf83",
|
||||
"source_hash": "sha256:c3bc35f60d36197aa1df7126513a85b5d4217fd0db3f32ece445d9a1ef76e870",
|
||||
"surface_hash": "sha256:631b73b174f48cb0cca7c8449e80920739010d0db223dac2855101f4dbd0eda6",
|
||||
"catalog": {
|
||||
"agent_metadata": {
|
||||
@@ -141587,7 +141587,7 @@
|
||||
"type": "string"
|
||||
},
|
||||
"rooms": {
|
||||
"description": "会议室 roomId 列表,逗号分隔 (创建时直接预定,roomId 必须来自 `room search` 返回,若是循环会议,必须设置recurrence-end-date,避免长期预订)",
|
||||
"description": "会议室 roomId 列表,逗号分隔 (创建时直接预定,roomId 必须来自“room search”返回,若是循环会议,必须设置recurrence-end-date,避免长期预订)",
|
||||
"field_provenance": {
|
||||
"description": {
|
||||
"candidates": [
|
||||
@@ -141595,7 +141595,7 @@
|
||||
"precedence": "cobra_contract",
|
||||
"selected": true,
|
||||
"source": "cobra_usage",
|
||||
"value": "会议室 roomId 列表,逗号分隔 (创建时直接预定,roomId 必须来自 `room search` 返回,若是循环会议,必须设置recurrence-end-date,避免长期预订)"
|
||||
"value": "会议室 roomId 列表,逗号分隔 (创建时直接预定,roomId 必须来自“room search”返回,若是循环会议,必须设置recurrence-end-date,避免长期预订)"
|
||||
},
|
||||
{
|
||||
"precedence": "mcp_metadata",
|
||||
@@ -141613,7 +141613,7 @@
|
||||
"precedence": "cobra_contract",
|
||||
"resolution": "highest_precedence",
|
||||
"source": "cobra_usage",
|
||||
"value": "会议室 roomId 列表,逗号分隔 (创建时直接预定,roomId 必须来自 `room search` 返回,若是循环会议,必须设置recurrence-end-date,避免长期预订)"
|
||||
"value": "会议室 roomId 列表,逗号分隔 (创建时直接预定,roomId 必须来自“room search”返回,若是循环会议,必须设置recurrence-end-date,避免长期预订)"
|
||||
},
|
||||
"interface_type": {
|
||||
"candidates": [
|
||||
|
||||
@@ -1173,7 +1173,7 @@ func newCalendarCommand() *cobra.Command {
|
||||
eventCreateCmd.Flags().String("members", "", "")
|
||||
_ = eventCreateCmd.Flags().MarkHidden("members")
|
||||
eventCreateCmd.Flags().String("open-dingtalk-ids", "", "openDingTalkId 列表,逗号分隔 (与 --attendees 至少传一个)")
|
||||
eventCreateCmd.Flags().String("rooms", "", "会议室 roomId 列表,逗号分隔 (创建时直接预定,roomId 必须来自 `room search` 返回,若是循环会议,必须设置recurrence-end-date,避免长期预订)")
|
||||
eventCreateCmd.Flags().String("rooms", "", "会议室 roomId 列表,逗号分隔 (创建时直接预定,roomId 必须来自“room search”返回,若是循环会议,必须设置recurrence-end-date,避免长期预订)")
|
||||
eventCreateCmd.Flags().String("room-ids", "", "")
|
||||
_ = eventCreateCmd.Flags().MarkHidden("room-ids")
|
||||
eventCreateCmd.Flags().String("roomIds", "", "")
|
||||
|
||||
@@ -0,0 +1,39 @@
|
||||
// Copyright 2026 Alibaba Group
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
package helpers
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"strings"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestCrossPlatformCoverageCalendarEventCreateHelpKeepsRoomsStringMetavar(t *testing.T) {
|
||||
cmd := newCalendarCommand()
|
||||
var out bytes.Buffer
|
||||
cmd.SetOut(&out)
|
||||
cmd.SetErr(&out)
|
||||
cmd.SetArgs([]string{"event", "create", "--help"})
|
||||
if err := cmd.Execute(); err != nil {
|
||||
t.Fatalf("calendar event create --help: %v\n%s", err, out.String())
|
||||
}
|
||||
|
||||
help := out.String()
|
||||
if !strings.Contains(help, "--rooms string") {
|
||||
t.Fatalf("calendar event create help missing string metavar for --rooms:\n%s", help)
|
||||
}
|
||||
if strings.Contains(help, "--rooms room search") {
|
||||
t.Fatalf("calendar event create help treated description text as --rooms metavar:\n%s", help)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user